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.

Use ModuleConcatenationPlugin generates code that raises exceptions

See original GitHub issue

Do you want to request a feature or report a bug? bug

What is the current behavior? This issue is related to #5266 and describes a build configuration where the use of the ModuleConcatenationPlugin generates code that no longer executes successfully. I’ve boiled down a production environment to a (hopefully) manageable repro case.

If the current behavior is a bug, please provide the steps to reproduce.

  1. extract the attached repro case
  2. run npm i
  3. run npm run build
  4. open index.html in browser
  5. The browser should now show an exception Uncaught ReferenceError: tinymce is not define
  6. Comment out the new webpack.optimize.ModuleConcatenationPlugin() in webpack.util.js
  7. run npm run build
  8. refresh index.html in browser
  9. The browser should now show the tinymce browser

webpack.zip

What is the expected behavior? ModuleConcatenationPlugin not to cause any alterations of the code that make it fail

If this is a feature request, what is motivation or use case for changing the behavior?

Please mention other relevant information such as the browser version, Node.js version, webpack version and Operating System. node: 8.1.4 npm: 4.6.1 os: windows 7

Issue Analytics

  • State:closed
  • Created 6 years ago
  • Comments:11 (4 by maintainers)

github_iconTop GitHub Comments

4reactions
sokracommented, Aug 8, 2017

This week

0reactions
thecodejackcommented, Sep 29, 2017

Not sure if its related but getting this error as mentioned in the link.

https://stackoverflow.com/questions/46488914/error-after-webpack-upgrade-from-2-to-3

Basically this is happening only when I add ModuleConcatenationPlugin to my prod build. I have dynamic imports.

ERROR in chunk main [entry]
[name].[chunkhash].js
'import' and 'export' may only appear at the top level (42:6)
|   if (false) {
|     module.hot.accept('./reducers', function () {
|       import('./reducers').then(function (reducerModule) {
|         var createReducers = reducerModule.default;
|         var nextReducers = createReducers(store.asyncReducers);
Read more comments on GitHub >

github_iconTop Results From Across the Web

ModuleConcatenationPlugin - 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 >
Webpack bundle increased in size after converting to ES2015 ...
I just converted our codebase from using CommonJS to using ES6 modules, and the webpack bundle has increased significantly in size.
Read more >
https://unpkg.com/webpack/types.d.ts
ConcatenationScope; /** * code generation results of other modules (need to have a codeGenerationDependency to use that) */ codeGenerationResults: ...
Read more >
webpack is not a constructor | The AI Search Engine You Control
I had encountered same problem before, the problem is this line of code: ... Vue is not a constructor error, using Typescript &...
Read more >
Angular 12 in Depth - Sébastien Dubois
Also, it won't be possible to create new applications using View Engine. ... Angular now generates less code for safe property access; ...
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