question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Build fails in CRA 5.0.0 (Webpack 5), due to ESM strict mode - "Module not found: Error: Can't resolve '../data-grid/data-grid-types'"

See original GitHub issue

I’m trying to use glide-data-grid in fresh application, bootstrapped by creat-react-app@5.0.0, but it fails to build it:

CleanShot 2022-03-24 at 21 19 49@2x

It seems to be caused by ESM strict mode which is enabled by webpack 5 (since v5.0.0-beta.30 release) which requires extensions in esm imports

Possible solution

https://www.npmjs.com/package/typescript-esm might help here


Reproduction example:

Issue Analytics

  • State:closed
  • Created a year ago
  • Comments:7 (5 by maintainers)

github_iconTop GitHub Comments

1reaction
jassmithcommented, Mar 25, 2022

Fixed in 4.0.0

1reaction
jassmithcommented, Mar 24, 2022

Thank you, I will look into typescript-esm. Very annoying that they turned on strict mode in CRA 5, not sure I really see the benefit.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Webpack5 ESM strict mode · Issue #12058 · babel ... - GitHub
Bug Report Webpack5 beta.30 has enabled strict mode on the ESM modules ... webpack 5.0.0-beta.30 Module not found: Error: Can't resolve '.
Read more >
i tried to Polyfill modules in webpack 5 but not working (Reactjs)
I resolve these errors but my app did not render. ... To use polyfill in webpack 5 in reactjs Follow the below steps:....
Read more >
Setting up a React app from scratch withWebpack, Babel and ...
The core function of Webpack is that it takes a bunch of JavaScript files we write in our project and turns them into...
Read more >
react-app-rewired - npm
When running in development mode, create-react-app does not use the usual Webpack config for the Development Server (the one that serves the app ......
Read more >
webpack < 5 used to include polyfills for node.js core modules ...
Failed to compile. Module not found: Error: Can't resolve 'stream' in ... node_modules/react-moralis/lib/index.esm.js 3:0-36 5307:11-24 @ .
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found