-
-
Notifications
You must be signed in to change notification settings - Fork 8.4k
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
$setup.bar is not a function
with script setup
#4599
Comments
works fine in sfc, It's not a vue core bug. Maybe relate to |
The compiler fails to detect that The error must be somewhere in this function: More specifically, it likely strips out the It's not just the function signature though, as it works for a simple interpolation like PS: The repo project doesn't use the |
Okay, got it. It's actually the empty string that is tripping up <div
:class="[
foo ? 'xxx' : bar(),
'foo',
]"
> The issue is that the regex in function stripStrings(exp) {
return exp
- .replace(/'[^']+'|"[^"]+"/g, '')
+ .replace(/'[^']*'|"[^"]*"/g, '')
.replace(/`[^`]+`/g, stripTemplateString);
} |
Version
3.2.11
Reproduction link
github.com
Steps to reproduce
Run
npm run serve
in the reproduction repository, go to http://localhost:8080/ and check the dev consoleWhat is expected?
The code should work fine and we should see "Hello World" in the browser
What is actually happening?
I get an error about
$setup.bar is not a function
in the dev consoleThe text was updated successfully, but these errors were encountered: