slate-yjs icon indicating copy to clipboard operation
slate-yjs copied to clipboard

fix: add extension to the request

Open typehorror opened this issue 1 year ago • 2 comments

This address the issue when using CRA 5.x or other Webpack module resolution

See: https://nodejs.org/api/esm.html#esm_mandatory_file_extensions

Compiled with problems:

ERROR in ./node_modules/@slate-yjs/react/dist/index.js 66:0-68

Module not found: Error: Can't resolve 'use-sync-external-store/shim' in '/xxx/node_modules/@slate-yjs/react/dist'
Did you mean 'index.js'?
BREAKING CHANGE: The request 'use-sync-external-store/shim' 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.


ERROR in ./node_modules/@slate-yjs/react/dist/index.js 67:0-94

Module not found: Error: Can't resolve 'use-sync-external-store/shim/with-selector' in '/xxx/node_modules/@slate-yjs/react/dist'
Did you mean 'with-selector.js'?
BREAKING CHANGE: The request 'use-sync-external-store/shim/with-selector' 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've added the extension as required. I don't believe this would generate any backward compatibility issue but I can't guarantee it.

typehorror avatar Apr 12 '23 21:04 typehorror

🦋 Changeset detected

Latest commit: 523c4b849ac56adefb3e33c0571d41ee07bf57d7

The changes in this PR will be included in the next version bump.

This PR includes changesets to release 2 packages
Name Type
@slate-yjs/react Minor
@slate-yjs/example Patch

Not sure what this means? Click here to learn what changesets are.

Click here if you're a maintainer who wants to add another changeset to this PR

changeset-bot[bot] avatar Apr 12 '23 21:04 changeset-bot[bot]

@BitPhinix I suspect the linter config would have to be updated to accept extensions on these imports

typehorror avatar Apr 13 '23 16:04 typehorror