Open aumann opened 3 years ago
I should add that this is basically fresh from the template vue-cli has created for me, that is it is a minimization of the issue I see in the real product. I'm still investigating what the crucial diff in package-lock between the running and failing versions is. But maybe someone has a hint (e.g. any known babel issues?)
I have the same issue any news.
I've got it back to running in our "real" project. But only by going back to a package-lock.json based on vue-cli 4.3
.
I did not yet try creating a fresh project with this cli version, maybe that works, too, as a minimization.
The only thing I have definitely verified: Upgrading to vue-cli beyond ~4.3 re-introduces the error, i.e. breaks my package-lock.json ( break as in downgrading cli back to 4.3 does not fix the build. Only after reverting back to the old lock file.
There are 2 workaround options.
target: 2019
in tsconfig.json. plugins: [
'@babel/plugin-proposal-nullish-coalescing-operator',
'@babel/plugin-proposal-optional-chaining',
]
https://github.com/vuejs/vue-cli/issues/4738#issuecomment-565057952
Thank you very much. I can confirm that this solves the issue for me.
Can the defaults in Vue-CLI be adapted accordingly to help future users?
I complement the answer for || = and similar operators. Add to plugins '@babel/plugin-proposal-logical-assignment-operators'.
Version
4.5.15
Reproduction link
github.com
Environment info
Steps to reproduce
Checkout current main of reproducer repository (faf2ae989ad at the time of writing)
Run
npm install && npm run test:unit
What is expected?
The one test is run and completes successfully. Just as it does if I remove the offending typescript code.
What is actually happening?
Serving and building work, i.e. both
npm run build
andnpm run serve
complete successfullyPlease let me know if you need any more information.