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

[Bug]: vue 2.6+ vue-loader will parse the template of the.vue file with JS rule #6768

Closed
Camusama opened this issue Jun 11, 2024 · 2 comments
Labels
bug Something isn't working

Comments

@Camusama
Copy link

Camusama commented Jun 11, 2024

System Info

System:
OS: macOS 14.5
CPU: (10) arm64 Apple M1 Pro
Memory: 95.41 MB / 16.00 GB
Shell: 5.9 - /bin/zsh
Binaries:
Node: 18.15.0 - ~/.nvm/versions/node/v18.15.0/bin/node
Yarn: 1.22.19 - ~/.nvm/versions/node/v18.15.0/bin/yarn
npm: 9.5.0 - ~/.nvm/versions/node/v18.15.0/bin/npm
pnpm: 7.26.2 - ~/Library/pnpm/pnpm
Browsers:
Chrome: 125.0.6422.142
Safari: 17.5

Details

vue 2.6+ vue-loader will parse the template of the.vue file with JS rule

related to #5372

image

Errors in real projects look like this:

help: File was processed with this loader:
'xxx/node_modules/vue-loader/lib/loaders/templateLoader.js??
vue-loader-options$builtin:swc-loader??
clonedRuleSet-157.use[0]$/xxx/node_modules/vue-loader/lib/index.js??
vue-loader-options

Reproduce link

https://github.com/Camusama/rspack-vue1.6-loader-issue

Reproduce Steps

git clone

https://github.com/Camusama/rspack-vue1.6-loader-issue

remove this 'resourceQuery' config , then you can reproduce it

https://github.com/Camusama/rspack-vue1.6-loader-issue/blob/main/rsbuild.config.ts#L17

@Camusama Camusama added bug Something isn't working pending triage The issue/PR is currently untouched. labels Jun 11, 2024
@LingyuCoder
Copy link
Collaborator

Rsbuild does not support vue 2.6, after I installed with pnpm and upgrade to vue 2.7, it works well. cc @chenjiahan

@LingyuCoder LingyuCoder removed the pending triage The issue/PR is currently untouched. label Jun 12, 2024
@chenjiahan
Copy link
Member

The Rsbuild Vue 2 plugin only supports Vue >= 2.7.0:

image

https://rsbuild.dev/plugins/list/plugin-vue2

Please upgrade to Vue 2.7 and try again.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

3 participants