Uncaught Error: ES Modules may not assign module.exports or exports.*, Use ESM export syntax

See original GitHub issue

After upgrading to the latest version of vue-axios, I got the following error message.

***** Fatal JavaScript exception - application has been terminated. ***** NativeScript encountered a fatal error: Uncaught Error: ES Modules may not assign module.exports or exports.*, Use ESM export syntax, instead: ./node_modules/vue-axios/dist/vue-axios.esm.min.js at set(file: app/webpack:/douyou/webpack/runtime/harmony module decorator:7:0 at ./node_modules/vue-axios/dist/vue-axios.esm.min.js(file: app/webpack:/douyou/node_modules/vue-axios/dist/vue-axios.esm.min.js:1:688 at __webpack_require__(file: app/webpack:/douyou/webpack/bootstrap:19:0 at ./app/main.js(file:///app/bundle.js:28:68) at __webpack_require__(file: app/webpack:/douyou/webpack/bootstrap:19:0 at __webpack_exec__(file:///app/bundle.js:12601:39) at (file:///app/bundle.js:12602:221) at __webpack_require__.X(file: app/webpack:/douyou/webpack/runtime/startup entrypoint:6:0 at (file:///app/bundle.js:12602:47) at (file:///app/bundle.js:12607:3) at require(:1:137)

Any suggestions for the above errors? Thanks.

Issue Analytics

  • State:open
  • Created 2 years ago
  • Comments:13 (8 by maintainers)

github_iconTop GitHub Comments

1reaction
shilikcommented, Sep 10, 2021

@hotrungnhan Thanks for the description for the possible solution. You are right, I just upgraded @nativescript/webpack from 5.0.0-rc.8 to formal release of 5.0.0. But vue-axios is the only plugin that yielded the errors after the upgrade.

1reaction
hotrungnhancommented, Sep 10, 2021

the lastest version using esm export system , which is conflig with some code in src.

import VueAxios from "vue-axios"

Let try commonjs build instead.

Import VueAxios from "vue-axios/dist/vue-axios.common.min
Read more comments on GitHub >

github_iconTop Results From Across the Web

ES Modules may not assign module.exports or exports.*, Use ...
I get this error when I try to export a function with module.exports and when I import it inside another file. I tried...
Read more >
Error: ES Modules may not assign module.exports or ... - GitHub
Error: ES Modules may not assign module.exports or exports.*, Use ESM export syntax, instead: 581 #12731.
Read more >
How to transpile ES modules with webpack and Node.js
Learn how webpack interacts with and supports ES modules in this deep dive tutorial ... Also note that we can have default exports...
Read more >
exports-loader - webpack
Allow to setup exports module.exports / export for source files. Useful when a source file does not contain exports or something does not...
Read more >
Error when trying to implement laravel translation into vuejs file
app.js:417882 Uncaught Error: ES Modules may not assign module.exports or exports.*, Use ESM export syntax, instead: ./resources/app/translation.js at ...
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