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.

moduleraid breaks when used in a Webpack v5 bundle

See original GitHub issue

What the title says 😅 For some reaosn the result of require('moduleraid') in an app bundled with Webpack v5 is an empty object.

See a repro in this repo https://github.com/eramdam/moduleraid-webpack5-repro

Issue Analytics

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

github_iconTop GitHub Comments

1reaction
eramdamcommented, Feb 25, 2021

@tomer8007 Hum, it seems like @pedroslopez’s fix allows moduleraid to inspect a webpack v5 bundle. My issue happens when bundling moduleraid in a webpack v5 bundle 😅

1reaction
eramdamcommented, Oct 22, 2020

@ScriptedAlchemy the issue isn’t that moduleraid can’t access Webpack v5’s package at runtime, which I would expect, but rather than using moduleraid in a Webpack 5 bundle results in the imported moduleraid code to not work/be an empty object 😅

EDIT: Weirdly enough, importing the source file directly into the codebase works fine, so I guess whatever is wrong lies in the dist file present in the npm package

Read more comments on GitHub >

github_iconTop Results From Across the Web

Dynamic require breaks when using more than one webpack ...
I've run into this issue several times, and it seems the reason behind it lies in conflict between multiple webpack bundles.
Read more >
Code Splitting - webpack
This feature allows you to split your code into various bundles which can then be loaded on demand or in parallel. It can...
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 >
To v5 from v4 - webpack
This guide aims to help you migrating to webpack 5 when using webpack directly. If you are using a higher level tool to...
Read more >
Tree Shaking - webpack
Tree shaking is a term commonly used in the JavaScript context for dead-code elimination. It relies on the static structure of ES2015 module...
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