TypeError: __webpack_modules__[moduleId] is not a function using Sentry Plugin with Webpack 5
See original GitHub issueEnvironment
How do you use Sentry? (-)
Which SDK and version? latest
Steps to Reproduce
- Use the latest webpack 5.27.2
- Use the latest sentry-webpack-plugin
- Create two entries, e. g.
master
andslave
- Configure
dependOn: 'master'
ofslave
entry, to store all webpack runtime code atmaster
entry - Build, run
Expected Result
App not falling
Actual Result
Uncaught TypeError: __webpack_modules__[moduleId] is not a function
at __webpack_require__ (master.js:22)
at __webpack_exec__ (slave.js:14)
at slave.js:15
at webpackJsonpCallback (master.js:114)
at slave.js:1
Isolated repro: https://github.com/irudoy/webpack-sentry-repro
Seems like it works fine when this code with SENTRY_RELEASE
is not injected:
Issue Analytics
- State:
- Created 2 years ago
- Comments:12 (3 by maintainers)
Top Results From Across the Web
WebPack - TypeError: __webpack_modules__[moduleId] is ...
I'm struggling with a WebPack error that occur when I use my custom library hosted as a package and streamed with NPM Link....
Read more >DefinePlugin | webpack
The DefinePlugin replaces variables in your code with other values or ... If the value isn't a string, it will be stringified (including...
Read more >EnvironmentPlugin | webpack
webpack is a module bundler. Its main purpose is to bundle JavaScript files for usage in a browser, yet it is also capable...
Read more >HashedModuleIdsPlugin - webpack
HashedModuleIdsPlugin. This plugin will cause hashes to be based on the relative path of the module, generating a four character string as the...
Read more >Webpack 5 release (2020-10-10)
webpack is a module bundler. Its main purpose is to bundle JavaScript files for usage in a browser, yet it is also capable...
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Seems like it was resolved in the latest version 👍
@kamilogorek unfortunately, storing runtime code in another entry with the
dependOn
option is the only option for us. Anyway, it’s documented webpack feature, and the sentry plugin should support it, I think. Maybe I can help to fix it by making a PR?