Skip to content
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

Failed to compile on v3 #1271

Open
mrquokka opened this issue Mar 16, 2023 · 8 comments
Open

Failed to compile on v3 #1271

mrquokka opened this issue Mar 16, 2023 · 8 comments

Comments

@mrquokka
Copy link

mrquokka commented Mar 16, 2023

After upgrade build crushed
node_17.2.0

-  Building for production...
 ERROR  Failed to compile with 1 error03:48:10

 error  in ./node_modules/v-calendar/dist/es/index.js

Module parse failed: Unexpected token (1809:19)
You may need an appropriate loader to handle this file type, currently no loaders are configured to process this file. See https://webpack.js.org/concepts#loaders
| const resolveEl = (target) => {
|   if (target == null)
>     return target ?? null;
|   if (document && isString_1(target))
|     return document.querySelector(target);

 @ ./node_modules/cache-loader/dist/cjs.js!./node_modules/vue-cli-plugin-coffee/node_modules/thread-loader/dist/cjs.js!./node_modules/babel-loader/lib!./node_modules/coffee-loader/dist/cjs.js!./node_modules/cache-loader/dist/cjs.js??ref--1-0!./node_modules/@vue/cli-service/node_modules/vue-loader-v16/dist??ref--1-1!./src/components/date_picker.vue?vue&type=script&lang=coffee 2:0-40 7:17-27
 @ ./src/components/date_picker.vue?vue&type=script&lang=coffee
 @ ./src/components/date_picker.vue
 @ ./node_modules/cache-loader/dist/cjs.js!./node_modules/vue-cli-plugin-coffee/node_modules/thread-loader/dist/cjs.js!./node_modules/babel-loader/lib!./node_modules/coffee-loader/dist/cjs.js!./node_modules/cache-loader/dist/cjs.js??ref--1-0!./node_modules/@vue/cli-service/node_modules/vue-loader-v16/dist??ref--1-1!./src/App.vue?vue&type=script&lang=coffee
 @ ./src/App.vue?vue&type=script&lang=coffee
 @ ./src/App.vue
 @ ./src/main.js
 @ multi ./src/main.js ./src/add_metrics.js
@Jebasuthan
Copy link

After upgrade build crushed

@mrquokka I am also facing the same issue. Any luck?

@crodrigueza16
Copy link

Same with node 14.21.3

@mrquokka
Copy link
Author

mrquokka commented Mar 17, 2023

After upgrade build crushed

@mrquokka I am also facing the same issue. Any luck?

i think that problems is Nullish_coalescing (??) - i can try to change node/babel versions if author disagree to replace it :(

@ioannisgiannis
Copy link

Hello,

Same issue for me.
After upgrading from v3.0.0 to v3.0.1 the npm install failed.
vue.js: v3.2.47
node.js: v16.19.0

Screenshot of the error:
image

@crodrigueza16
Copy link

At the moment, I have fixed version 3.0.0-alpha.8 in my package.json to avoid this problem.

@mrquokka
Copy link
Author

mrquokka commented Mar 22, 2023

Solved by upgrade to vue-cli 5.* versions instead of 4.5.* + core-js (just make new temp package and copy dependecies)
(remember, you may need this fix vuejs/vue-cli#6785)

@kovelo
Copy link

kovelo commented Apr 5, 2023

Same issue here, it is definitely due to the nullish-coalescing-operator. Adding that plugin to my babel configuration does not fix the issue though.

@kovelo
Copy link

kovelo commented Apr 6, 2023

Update, I have fixed this...

  1. Install @babel/plugin-proposal-nullish-coalescing-operator as a dev dependency
  2. Update babel.config.js and add it as a plugin, here is my babel.config
module.exports = {
  presets: [
    '@vue/cli-plugin-babel/preset'
  ],
 plugins: [
    '@babel/plugin-proposal-optional-chaining',
    '@babel/plugin-proposal-private-methods',
    '@babel/plugin-proposal-nullish-coalescing-operator'
  ]
}
  1. Update vue.config.js to transpile the v-calendar dependency, here is the relevant part
module.exports = {
  transpileDependencies: [
    'v-calendar'
  ]
}

That should solve this issue.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

5 participants