TeemuKoivisto / prosemirror-dev-toolkit

Injectable developer tools for ProseMirror rich-text editors implemented in Svelte and TypeScript.
https://teemukoivisto.github.io/prosemirror-dev-toolkit/
MIT License
117 stars 6 forks source link

fix: include extension to the import #13

Closed ocavue closed 2 years ago

ocavue commented 2 years ago

Got the following error when I use version 0.0.9:

[success] [webpackbar] Client: Compiled with some errors in 6.18m

Module not found: Error: Can't resolve './empty' in '/home/runner/work/remirror/remirror/node_modules/.pnpm/prosemirror-dev-toolkit@0.0.9/node_modules/prosemirror-dev-toolkit/dist'
Did you mean 'empty.js'?
BREAKING CHANGE: The request './empty' 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.
Client bundle compiled with errors therefore further build is impossible. 

Seems that we need to use from 'empty.js' instead of from 'empty' in dist/index.js. The error above is gone after I made this change.

TeemuKoivisto commented 2 years ago

Hmm the incompatibility between modules and cjs is tad annoying at times. Wonder why it doesn't break for me. Oh well.

whawker commented 2 years ago

Fantastic, thanks @TeemuKoivisto and @ocavue! Any chance this could be released?

TeemuKoivisto commented 2 years ago

Fantastic, thanks @TeemuKoivisto and @ocavue! Any chance this could be released?

Great point! Released a new patch v0.0.10