kieler / elkjs

ELK's layout algorithms for JavaScript
Other
1.8k stars 97 forks source link

Bug elk library #230

Closed trantuandatvietnam closed 4 months ago

trantuandatvietnam commented 1 year ago

I take a error look like: ERROR in ./node_modules/reaflow/dist/reaflow.js 19:0-40 Module not found: Error: Can't resolve 'elkjs/lib/elk.bundled' in 'D:\work-company\upgrade\dmp-frontend\node_modules\reaflow\dist' Did you mean 'elk.bundled.js'? BREAKING CHANGE: The request 'elkjs/lib/elk.bundled' failed to resolve only because it was resolved as fully specified (probably because the origin is strict EcmaScript Module, e. g. a module with javascript mimetype, a '.mjs' file, or a '.js' file where the package.json contains '"type": "module"'). The extension in the request is mandatory for it to be fully specified. Add the extension to the request.

I'm use react 18

Fransoic commented 1 year ago

I have the same error with Qwik (Vite) and React 18

[vite] Internal server error: Cannot find module '/home/XXX/node_modules/elkjs/lib/elk.bundled' imported from /home/XXX/node_modules/reaflow/dist/reaflow.js Did you mean to import elkjs/lib/elk.bundled.js? at new NodeError (node:internal/errors:371:5) at finalizeResolution (node:internal/modules/esm/resolve:416:11) at moduleResolve (node:internal/modules/esm/resolve:932:10) at defaultResolve (node:internal/modules/esm/resolve:1044:11) at ESMLoader.resolve (node:internal/modules/esm/loader:422:30) at ESMLoader.getModuleJob (node:internal/modules/esm/loader:222:40) at ModuleWrap. (node:internal/modules/esm/module_job:76:40) at link (node:internal/modules/esm/module_job:75:36)

soerendomroes commented 1 year ago

How do you import elkjs? I suggest using it as specified here.