Closed gersur closed 2 months ago
Directory imports don't seem to be supported by ES modules. I'm now updating js-draw
to avoid directory imports.
Thank you for reporting this!
Related StackOverflow post: https://stackoverflow.com/questions/64453859/directory-import-is-not-supported-resolving-es-modules-with-node-js
Thanks for the support and quick response!
I think this import is invalid because it's pointing to .mjs file, which doesn't exist
export { default as SVGLoader } from './SVGLoader.mjs';
Yeah, I guess you're right, mjs doesn't support directory import
I'm re-opening this until the new version has been released.
This should be fixed in v1.20.3. Please let me know if this is still an issue.
For future reference, the .mjs
extension is added by the build script on this line. A regression test for this issue can be found here.
Describe the issue
Module not found: Can't resolve './SVGLoader.mjs' Module not found: Can't resolve './widgets/InsertImageWidget.mjs'
Steps to reproduce the issue
js-draw@v1.20.2
in Next.js Projectnext build
Expected behavior
Build Successful
Observed behavior
js-draw
works on v1.18.0
What I suspect from the changes v1.18.0 to v1.19.0 is
SVGLoader.ts
is moved toSVGLoader/index.ts
. But in thejs-draw/dist/mjs/lib.mjs
,SVGLoader.ts
import doesn't changedpackages/js-draw/src/SVGLoader.ts → packages/js-draw/src/SVGLoader/index.ts
Version information
1.20.2
Platform
No response
Logs
Additional information
No response