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
Fetching data in a setup script from an url that has ${variable} in the url is not possible. #14722
Comments
The problem was not found. Please provide a correct link |
@516310460 I dont know what you are on about. That stackblitz seems to be different from the one I posted. The only difference between yours and mine is the weird folder of aaa and the template by the looks of it.
Works:
I don't see a logic in why that should make computed stop working. |
Here is another repro based on your stackblitz: https://stackblitz.com/edit/nuxt-starter-pr2brk?file=pages%2Faaa%2F[slug].vue |
I would guess that this might be similar to unjs/mlly#64. |
@danielroe Is it something that needs to be fixed in nuxt or is there something I need to do? |
@SebbeJohansson I can't reproduce with the linked stackblitz. Is there a specific URL I need to go to or step I need to take? |
@danielroe Yes! I specified it as "Test url" in the oriignal comment. Maybe I wasn't clear enough. |
My bad - perfect 👍 @antfu - might be a possible unimport issue. |
I have also had this issue...
This throws an error with whatever is directly below the variable declation |
This is no longer replicable: https://stackblitz.com/edit/nuxt-starter-h35gez. Let me know if you're still experiencing this and I'd be happy to reopen/look at this again. |
Environment
Nuxt CLI v3.0.0-rc.8 15:57:24
RootDir: /home/projects/nuxt-starter-si1vu3 15:57:27
Nuxt project info: 15:57:27
Linux
v16.14.2
3.0.0-rc.8
npm@7.17.0
vite
-
-
-
Reproduction
https://stackblitz.com/edit/nuxt-starter-si1vu3?file=pages%2Fblog%2F[slug].vue,pages%2F[...slug].vueexampl%2Ce
Test url:
https://nuxt-starter-si1vu3--3000.local.webcontainer.io/blog/storyblok-datetime-field-with-today-as-default
Describe the bug
I expect it to be possible to use:
to pull data in a setup script, but I'm getting
computed is not defined
when I do that.If I instead do:
it works fine.
I cant use the working version because of eslint auto formatting it.
Additional context
Even if i make a variable that has the whole URL it still errors if I use
${variable}
.Logs
No response
The text was updated successfully, but these errors were encountered: