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.

TypeError: __webpack_modules__[moduleId] is not a function using Sentry Plugin with Webpack 5

See original GitHub issue

Environment

How do you use Sentry? (-)

Which SDK and version? latest

Steps to Reproduce

  1. Use the latest webpack 5.27.2
  2. Use the latest sentry-webpack-plugin
  3. Create two entries, e. g. master and slave
  4. Configure dependOn: 'master' of slave entry, to store all webpack runtime code at master entry
  5. 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: image

Issue Analytics

  • State:closed
  • Created 2 years ago
  • Comments:12 (3 by maintainers)

github_iconTop GitHub Comments

1reaction
irudoycommented, Mar 2, 2022

Seems like it was resolved in the latest version 👍

1reaction
irudoycommented, Jun 25, 2021

@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?

Read more comments on GitHub >

github_iconTop 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 >

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