Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

version 2.12.0 , feature "ESM Compatible" breaks React app CRA build with Chackra UI #303

Closed
izinin opened this issue Apr 20, 2024 · 3 comments

Comments

@izinin
Copy link

izinin commented Apr 20, 2024

in version 2.12.0 (the latest) there was introduced feature "ESM Compatible". This change breaks my CRA build in Chackra UI:

Module not found: Error: Can't resolve './Combination' in '/Users/igorzinin/myup/xmpp_converse/connectorfe/node_modules/@chakra-ui/focus-lock/node_modules/react-focus-lock/dist/es2015'
Did you mean 'Combination.js'?
BREAKING CHANGE: The request './Combination' 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 do not maintain Chackra UI where your component dependency is not pinned. So i cannot downgrade react-focus-loc. Please suggest me how i can make it compatible with strict resolution by webpack?

@JohnnyTheTank
Copy link

same issue here:

  ▲ Next.js 14.2.2
  - Environments: .env

 ✓ Linting and checking validity of types    
   Creating an optimized production build ...
 ✓ Compiled successfully
   Collecting page data  ..Error [ERR_MODULE_NOT_FOUND]: Cannot find module '/Users/bla/Work/ffstable/node_modules/react-focus-lock/dist/es2015/Combination' imported from /Users/bla/Work/ffstable/node_modules/react-focus-lock/dist/es2015/index.js
    at finalizeResolution (node:internal/modules/esm/resolve:263:11)
    at moduleResolve (node:internal/modules/esm/resolve:908:10)
    at defaultResolve (node:internal/modules/esm/resolve:1131:11)
    at ModuleLoader.defaultResolve (node:internal/modules/esm/loader:390:12)
    at ModuleLoader.resolve (node:internal/modules/esm/loader:359:25)
    at ModuleLoader.getModuleJob (node:internal/modules/esm/loader:234:38)
    at ModuleWrap.<anonymous> (node:internal/modules/esm/module_job:85:39)
    at link (node:internal/modules/esm/module_job:84:36) {
  code: 'ERR_MODULE_NOT_FOUND',
  url: 'file:///Users/bla/Work/ffstable/node_modules/react-focus-lock/dist/es2015/Combination'
}

@jomorais
Copy link

Same problem building a react app using ChakraUI:

Failed to compile.

Module not found: Error: Can't resolve './Combination' in '/usr/src/app/node_modules/react-focus-lock/dist/es2015'
Did you mean 'Combination.js'?
BREAKING CHANGE: The request './Combination' 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.

@theKashey
Copy link
Owner

duplicate #301

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

No branches or pull requests

4 participants