We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
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
<script setup generic="...">
3.4.0-beta.4
https://play.vuejs.org/#eNqVU8tu2zAQ/BWCZ4sq4JxcN0hbpEB7aIs0R14UcaMw5QvLlWMg8L93SdmpZARBexK5MxzNDpfP8mNKajeC3MgtgU+uI7jUQYdtu9zmHm0i4bowfNCSspYiA43pSJ5g3sgVg30M93ZQjzkGFn7WQQgt++iTdYA/EtkYWGAjKlKwzrn49K3WCEdYner9A/S/X6k/5n2pafkTIQPuQMsXjDocgCb4+td32PP6BfTRjI7Zb4A3kKMbi8eJ9mkMhm3PeNXtV58ikg3Dbb7eE4R8aqoYLcxD5WvJ6X5+o/W/dtdqXc/pcOAUbdVvfJfOcpyApQj/YzL7QJTypm17E/iYAWd3qAJQG5Jvr5jW4hjIemhM9FdrdaHeNXdAnbpojc00RxVk39xhfOKAVcJoWHAWQtGq0WODEAxgiejfLJwde8XGGWNhpbiY5VSyPU3wcUjrYIoBAqDteVpvBd8zS2VxA31Es82EfHErMX0vteTBnWIVX2IU9xg9N6Ja3hRpLd8vZpw3s8chxNbYXV3wMrtIop3K3EupL54SOz6qnj25/5Q5/AFjokEt
Open Comp.vue component, select Vue 3.4.0-beta.4, and make some edit (add a space for example) to trigger the compiler.
Comp.vue
Then, if you replace generic="T extends Record<string, string>" with generic="T extends object", the problem disappear.
generic="T extends Record<string, string>"
generic="T extends object"
Removing import Foo from "./Foo.vue" make the error to disappear too.
import Foo from "./Foo.vue"
generic="..." should accept any extends
generic="..."
extends
generic="..." no longer accepts to extends another generic type (containing a < character)
<
SyntaxError: [vue/compiler-sfc] Unterminated string constant. (1:0) src/Comp.vue 1 | <script setup generic="T extends Record<string, string>"> | ^ 2 | import Foo from "./Foo.vue"; 3 | </script> at constructor (https://cdn.jsdelivr.net/npm/@vue/[email protected]/dist/compiler-sfc.esm-browser.js:2499:19) at Parser.raise (https://cdn.jsdelivr.net/npm/@vue/[email protected]/dist/compiler-sfc.esm-browser.js:5366:19) at Object.unterminated (https://cdn.jsdelivr.net/npm/@vue/[email protected]/dist/compiler-sfc.esm-browser.js:4369:20) at readStringContents (https://cdn.jsdelivr.net/npm/@vue/[email protected]/dist/compiler-sfc.esm-browser.js:4107:16) at Parser.readString (https://cdn.jsdelivr.net/npm/@vue/[email protected]/dist/compiler-sfc.esm-browser.js:5252:9)
System: OS: macOS 14.0 CPU: (10) arm64 Apple M2 Pro Memory: 105.67 MB / 16.00 GB Shell: 3.6.1 - /opt/homebrew/bin/fish Binaries: Node: 21.4.0 - /opt/homebrew/bin/node Yarn: 1.22.21 - /opt/homebrew/bin/yarn npm: 10.2.4 - /opt/homebrew/bin/npm pnpm: 8.5.1 - ~/Library/pnpm/pnpm bun: 1.0.13 - /opt/homebrew/bin/bun Browsers: Brave Browser: 120.1.61.104 Chrome: 120.0.6099.129 npmPackages: vue: 3.4.0-beta.4 => 3.4.0-beta.4
I tried all versions of 3.4 and the problem seems to have appeared in 3.4.0-alpha.2.
3.4.0-alpha.2
Use the version selector on top right, choose alpha.1, make some edit to recompile (add a space anywhere for example) => Problem gone.
alpha.1
Choose alpha.2, make some edit => Problem is back.
alpha.2
The text was updated successfully, but these errors were encountered:
fix(compiler-core): fix parsing <script setup> generics with >
<script setup>
7aa3f25
close #9890
Closed via 7aa3f25
Sorry, something went wrong.
No branches or pull requests
Vue version
3.4.0-beta.4
Link to minimal reproduction
https://play.vuejs.org/#eNqVU8tu2zAQ/BWCZ4sq4JxcN0hbpEB7aIs0R14UcaMw5QvLlWMg8L93SdmpZARBexK5MxzNDpfP8mNKajeC3MgtgU+uI7jUQYdtu9zmHm0i4bowfNCSspYiA43pSJ5g3sgVg30M93ZQjzkGFn7WQQgt++iTdYA/EtkYWGAjKlKwzrn49K3WCEdYner9A/S/X6k/5n2pafkTIQPuQMsXjDocgCb4+td32PP6BfTRjI7Zb4A3kKMbi8eJ9mkMhm3PeNXtV58ikg3Dbb7eE4R8aqoYLcxD5WvJ6X5+o/W/dtdqXc/pcOAUbdVvfJfOcpyApQj/YzL7QJTypm17E/iYAWd3qAJQG5Jvr5jW4hjIemhM9FdrdaHeNXdAnbpojc00RxVk39xhfOKAVcJoWHAWQtGq0WODEAxgiejfLJwde8XGGWNhpbiY5VSyPU3wcUjrYIoBAqDteVpvBd8zS2VxA31Es82EfHErMX0vteTBnWIVX2IU9xg9N6Ja3hRpLd8vZpw3s8chxNbYXV3wMrtIop3K3EupL54SOz6qnj25/5Q5/AFjokEt
Steps to reproduce
Open
Comp.vue
component, select Vue 3.4.0-beta.4, and make some edit (add a space for example) to trigger the compiler.Then, if you replace
generic="T extends Record<string, string>"
withgeneric="T extends object"
, the problem disappear.Removing
import Foo from "./Foo.vue"
make the error to disappear too.What is expected?
generic="..."
should accept anyextends
What is actually happening?
generic="..."
no longer accepts to extends another generic type (containing a<
character)System Info
Any additional comments?
I tried all versions of 3.4 and the problem seems to have appeared in
3.4.0-alpha.2
.Use the version selector on top right, choose
alpha.1
, make some edit to recompile (add a space anywhere for example) => Problem gone.Choose
alpha.2
, make some edit => Problem is back.The text was updated successfully, but these errors were encountered: