Open davidyuk opened 3 years ago
Thank for reporting this issue!
Actually your workaround seems the best way to handle it. In fact UVue makes a specific build with Babel for Node environment, and that build do not include these babel plugins automatically
For future users coming, here the workaround, in babel.config.js
:
module.exports = {
presets: [
'@vue/cli-plugin-babel/preset',
],
plugins: [
'@babel/plugin-proposal-optional-chaining',
'@babel/plugin-proposal-nullish-coalescing-operator',
],
};
I keep this open in case I find a solution
Describe the bug Vue CLI has a richer set of Babel features than Uvue supports, we have to manually add missed features otherwise server failing with a message:
To Reproduce Try to run
vue-cli-service ssr:serve
on a project that uses optional chaining or nullish coalescing.Expected behavior To have Babel features enabled in Uvue out of the box, corresponding to the Vue CLI setup.
Additional context We have to add patches like this one as a workaround.
Please indicate versions of: