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.

ModuleConcatenation bailout: Module is not an ECMAScript module when inheriting exported based config

See original GitHub issue

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

What is the current behavior? When inheriting from a base webpack config provided by an npm module and merging via webpack-merge, ModuleConcatenation fails to properly concatenate, giving the bailout warning ‘Module is not an ECMAScript module’ (despite the fact all files are indeed ECMAScript modules).

If the current behavior is a bug, please provide the steps to reproduce. Created a simple repro repo here: https://github.com/jdb8/webpack-module-concat-repro. Instructions are detailed in README.md.

What is the expected behavior? The output bundle should successfully concatenate the module with ModuleConcatenationPlugin. It shouldn’t matter whether the plugin is defined in the base or child config, or whether the base config is exported from an npm module.

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

Please mention other relevant information such as the browser version, Node.js version, webpack version and Operating System. webpack@3.4.1, node@5.11.0

Issue Analytics

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

github_iconTop GitHub Comments

2reactions
trusktrcommented, Jun 27, 2019

Hmmm, seems like most of it was due to the entry point directly importing a single CommonJS module, which caused the not an ECMAScript module error to subsequently occur for almost every other imported module in the whole project.

The error wasn’t so helpful, it seems to have told me a bunch of actually-es2015 modules were not es2015 modules.

Then when I commented out the single import line – in my entry point which imported the CommonJS module – a bunch of stuff was able to concatenate and many of those not an ECMAScript module went away.

Seems like error reporting could use some love in this area (I know, error message helpfulness is usually the last thing people have time for 😊). Hopefully this is of any help to anyone who stumbles here.

0reactions
webpack-botcommented, Oct 30, 2019

Issue was closed because of inactivity.

If you think this is still a valid issue, please file a new issue with additional information.

Read more comments on GitHub >

github_iconTop Results From Across the Web

How to fix modules with "ModuleConcatenation bailout
I looked into understanding this bailout message, and one of the reasons it happens is when the module doesn't have imports or exports,...
Read more >
webpack/webpack - Gitter
to webpack config for webpack to generate index[hash].js. ... ModuleConcatenation bailout: Module is not an ECMAScript module */ /*! ./src/index.js */ /*!
Read more >
Automated Malware Analysis Report for https://info.rapid7.com ...
no static exports found */./*! all exports used */./*! ModuleConcatenation bailout: Module is not an ECMAScript module */function(z,q,e){var U ...
Read more >
Update Webpack core packages to v5 (major) (!104336) · Merge ...
Automerge: Disabled by config. Please merge this manually once you are satisfied. ♻ Rebasing: Whenever MR becomes conflicted, or you tick the rebase/retry ......
Read more >
https://www.tecnofala.com/wp-content/plugins/prest...
undefined\":_typeof(module))==='object')module.exports=factory();else if(typeof ... ModuleConcatenation bailout: Module is not an ECMAScript 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