Skip to content

fix: add extension to the request#389

Open
typehorror wants to merge 2 commits into
BitPhinix:mainfrom
brigalabs:fix-cra-5.x-strict-import
Open

fix: add extension to the request#389
typehorror wants to merge 2 commits into
BitPhinix:mainfrom
brigalabs:fix-cra-5.x-strict-import

Conversation

@typehorror
Copy link
Copy Markdown

@typehorror typehorror commented Apr 12, 2023

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.

@changeset-bot
Copy link
Copy Markdown

changeset-bot Bot commented Apr 12, 2023

🦋 Changeset detected

Latest commit: 523c4b8

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

@typehorror
Copy link
Copy Markdown
Author

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant