clientIO / joint

A proven SVG-based JavaScript diagramming library powering exceptional UIs
https://jointjs.com
Mozilla Public License 2.0
4.65k stars 850 forks source link

Import from `@clientio/rappid-visio` to Angular (11) #1478

Closed GeorgiyZhuravlev closed 3 years ago

GeorgiyZhuravlev commented 3 years ago

Hi!

We're trying to implement import/export to Visio in our Angular app (v11) Attempt to import anything from @clientio/rappid-visio produces errors shown below. Reproducible with the demo app apps / Chatbot / Angular10 (closest version to ours) if extended with:

// package.json
"@clientio/rappid-visio": "file:rappid/rappid-visio.tgz",

// somewhere in the code
import { VisioArchive } from '@clientio/rappid-visio';
...
// use VisioArchive

Could you give us a hint on how to resolve it, please?

ERROR in ./node_modules/@clientio/rappid-visio/src/formulas/FormulaParser.mjs 5:43-49
Can't import the named export 'Parser' from non EcmaScript module (only default export is available)

ERROR in ./node_modules/@clientio/rappid-visio/src/models/VisioSection.mjs 230:12-13
Can't import the named export 'V' from non EcmaScript module (only default export is available)

ERROR in ./node_modules/@clientio/rappid-visio/src/models/VisioShape.mjs 279:21-22
Can't import the named export 'V' from non EcmaScript module (only default export is available)

ERROR in ./node_modules/@clientio/rappid-visio/src/models/VisioShape.mjs 294:21-22
Can't import the named export 'V' from non EcmaScript module (only default export is available)

ERROR in ./node_modules/@clientio/rappid-visio/src/display/shape.mjs 61:22-23
Can't import the named export 'V' from non EcmaScript module (only default export is available)

ERROR in ./node_modules/@clientio/rappid-visio/src/display/shape.mjs 101:29-30
Can't import the named export 'V' from non EcmaScript module (only default export is available)
....
kumilingus commented 3 years ago

Hi @GeorgiyZhuravlev , you can remove module property from package.json inside of the rappid-visio.tgz for the time being. We need some time to investigate this. Thank you.

GeorgiyZhuravlev commented 3 years ago

@kumilingus

you can remove module property from package.json inside of the rappid-visio.tgz for the time being.

it did help with other errors, they're gone, but this one show up:

image

kumilingus commented 3 years ago

Is that reproducible in apps / Chatbot / Angular10?

GeorgiyZhuravlev commented 3 years ago

Is that reproducible in apps / Chatbot / Angular10?

No, Chatbot is ok with modified .tgz (no module property), no build errors...

Some new (more strict) TS settings, probably (V10 yours and V11 ours). I'll try to find/compare, but if you happen to know where exactly - would be much appreciated.

GeorgiyZhuravlev commented 3 years ago

I'll try to find

"skipLibCheck": true in tsconfig.json saved the day :)

I saw this somewhere in your documentation, but since @clientio/rappid (not visio related) was OK without it, I thought it's not the case anymore.

Anyway, thank you!