Incompatibility with vue-cli modern mode
See original GitHub issueEnvironment
- Plugin Version: 0.5.5
- Webpack Version: 4.28.1
- OS Version: Debian 9
- Node Version: 10
- NPM Version: 6
- @vue/cli-service Version: 3.3.0
Current Behavior
Uncaught TypeError: Cannot set property 'Obsolete' of undefined
when opened in modern browser with modules support
Expected Behavior
Work fine in both modern and legacy browsers
Detailed Description
Here are documentation about modern mode - https://cli.vuejs.org/guide/browser-compatibility.html#modern-mode
Issue Analytics
- State:
- Created 5 years ago
- Comments:5 (5 by maintainers)
Top Results From Across the Web
Browser Compatibility | Vue CLI
Vue CLI offers a "Modern Mode" to help you solve this problem. When building for production with the following command:.
Read more >VUE CLI-3 Project not working on IE-11 - Stack Overflow
Another solution: use the power of vue-cli-3 to leverage browser support: https://cli.vuejs.org/guide/browser-compatibility.html#modern-mode.
Read more >@vue/cli-plugin-babel | Yarn - Package Manager
Fix compatibility with the upcoming Vue 2.7 (currently in alpha) and Vue Loader 15.10 (currently in beta). In Vue 2.7, vue-template-compiler is no...
Read more >Building for Production - Vite
Browser Compatibility #. The production bundle assumes support for modern JavaScript. By default, Vite targets browsers which support the native ES Modules, ...
Read more >@vue/cli-plugin-babel - Awesome JS
Fix compatibility with the upcoming Vue 2.7 (currently in alpha) and Vue Loader 15.10 (currently in beta). In Vue 2.7, vue-template-compiler is no...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
I create a sample project for you - https://github.com/Djaler/obsolete-webpack-plugin-vue-cli-modern-mode-bug-sample
Steps to reproduce:
npm install
npm run build
This happens because in modern mode vue cli produces two versions for each script - for modern and legacy browsers. Modern browser will load
<script type=module>
:<script type=module src=/js/obsolete.5561cfbb.js></script>
and will not load<script nomodule
:<script src=/js/obsolete-legacy.5561cfbb.js nomodule></script>
. And legacy browser will do the opposite.The problem is that your script is not designed to run as an ES-module.
Awesome, thanks!