-
-
Notifications
You must be signed in to change notification settings - Fork 6.3k
Build fails with --target wc option on a Vue 3 project #5901
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
Comments
According to this comment, the functionality has not yet been implemented, so this is not really an issue yet. |
mee too!!! Module build failed (from ./node_modules/thread-loader/dist/cjs.js): @ ./src/pages/coupon/index.vue?vue&type=script&setup=props&lang=ts 1:0-430 1:0-430 1:431-850 1:431-850 |
add parallel: false in vue.config.js, can avoid this problem! |
Version
4.5.6
Reproduction link
https://github.com/adarean5/vue-wc-test
Environment info
Steps to reproduce
Run the npm script "build-wc", that is defined in the package.json (
vue-cli-service build --target wc --inline-vue --name my-element ./src/app/components/HelloWorld/HelloWorld.vue
).What is expected?
The build finishes successfully and outputs dist/my-element.js and dist/my-element.min.js.
If the same command is ran on a Vue 2 project the output is as follows:
What is actually happening?
The build fails with the following output:
Quick Update:
Upon running the build on one of my other projects (unfortunately I am not able to share the code), I got a similar error log minus the second Unexpected token error.
This time the component (Counter.vue), which I was trying to build as a web component, had no
script
tags, so that would explain why the second error was not thrown.The text was updated successfully, but these errors were encountered: