You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
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:
✔ Client
Compiled successfully in 21.96s
✖ Server
Compiled with some errors in 20.21s
DONE Compiled successfully in 21970ms 5:02:08 PM
I Server is running: http://localhost:8080
I Type "rs" to restart server
[1613656928782] INFO (17507 on Deniss-MacBook-Pro.local): Server listening: http://localhost:8080
[1613657140826] ERROR (17507 on Deniss-MacBook-Pro.local): Module parse failed: Unexpected token (392:178)
File was processed with these loaders:
* ./node_modules/cache-loader/dist/cjs.js
* ./node_modules/babel-loader/lib/index.js
* ./node_modules/cache-loader/dist/cjs.js
* ./node_modules/vue-loader/lib/index.js
You may need an additional loader to handle the result of these loaders.
| var _this$tokenInfo$this$;
|
> const decimals = ((_this$tokenInfo$this$ = this.tokenInfo[this.data.tokenAddress]) === null || _this$tokenInfo$this$ === void 0 ? void 0 : _this$tokenInfo$this$.decimals) ?? 18;
| const initialPrice = new BigNumber(aeToAtoms(1)); // currently supports only hardcoded 1AE
|
Error: Module parse failed: Unexpected token (392:178)
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 :
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:
The text was updated successfully, but these errors were encountered: