-
-
Notifications
You must be signed in to change notification settings - Fork 8.6k
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
Imported constants produce undefined when inside template string in DEV mode #4340
Comments
Update the dependency package (vue/vue-cli) to the latest version will not have this issue. |
I don't use vue-cli, I am using Vite. Repro link inside the issue was provided by your creating issues template. I just reproduced the error. The problem was a non-issue, until I updated my dependencies to the latest versions. I have my versions strict. (without |
And the latest vue release is 3.2.2 |
Here, I made a reproduction (using Vite starter template): https://github.com/sheremet-va/vue-template-string-setup-bug |
As a workaround, change this: <div>{{ `${VARIABLE}123` }}</div> to <div>{{ VARIABLE }}123</div>
<!-- or -->
<div>{{ VARIABLE + `123` }}</div> |
I want to point out, that the problem persist not only inside But workaround is working, yes. |
Just add a hint here, we can't completely strip the Template strings(Template literals), https://github.com/vuejs/vue-next/blob/master/packages/compiler-sfc/src/compileScript.ts#L2249 |
Version
3.2.2
Reproduction link
https://codesandbox.io/s/musing-lake-jx008?file=/src/App.vue
Steps to reproduce
Create
test.ts
file:Create
Comp.vue
file:What is expected?
123123 on screen
What is actually happening?
undefined123 on screen
The text was updated successfully, but these errors were encountered: