-
-
Notifications
You must be signed in to change notification settings - Fork 6.3k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Modern mode is breaking about @vue/cli-service and @vue/cli-plugin-typescript 3.4.0 #3438
Comments
Did some digging and the issue is actually caused by the ESLint plugin. It somehow calls |
I was actually able to reproduce on a default setup without TypeScript plugin involved. The required combination is ESLint plugin + a
@sodatea we need to look into this with high priority since modern mode is pretty much broken. |
Ok I think I found out a more serious flaw in the design. Modern mode currently relies on running the build twice with different env variables, and the babel preset dynamically returns different config based on the env variables. Technically, this should not work since the babel preset is cached by babel... but it happened to work when Currently, a workaround is using a self-invalidating module.exports = api => {
// 1. avoid this whole config from being cached
api.cache(() => process.env.VUE_CLI_MODERN_BUILD)
return {
presets: [
// 2. avoid the preset return value from being cached
// babel also caches presets based on their options
['@vue/app', { modern: process.env.VUE_CLI_MODERN_BUILD }]
]
}
} I think to properly fix this we need to fundamentally re-design modern mode to not rely on env variables. |
No wonder I can't get a reliable reproduction of this issue… |
Modern mode still hangs for me @vue/cli 3.5.3. Please could someone confirm which version this fix should be present in, or what the version dependencies are? |
@bigsee I believe it's fixed since @vue/cli-service 3.4.1 |
Updating |
issue is still here 👹 System: |
@lovetingyuan could you please provide a reproduction and open a new issue? |
https://github.com/lovetingyuan/vue-cli-modern-bug |
It's a duplicate of #3206 |
ok, thanks a lot. |
@sodatea why is babel required for modern mode? |
@rcheung9 For modern mode, we need to target the compiled code to those browsers who supports |
What about setting |
@babel/polyfill does not get provided when you use vue ui and install babel as a plugin. what am I missing here? |
Version
3.4.0
Reproduction link
https://github.com/yoyo930021/modern-mode-example
Environment info
Steps to reproduce
yarn build --modern
dist/js/app.[hash].js
async
orawait
not found and file is likedist/js/app-legacy.[hash].js
What is expected?
dist/js/app.[hash].js
haveasync
await
word.What is actually happening?
modern mode is breaking
If you try to run
yarn add --dev @vue/cli-plugin-typescript@3.3.0 && yarn add --dev @vue/cli-service@3.3.0
modern mode is succeed.
The text was updated successfully, but these errors were encountered: