Comments (8)
Hi @manniL . I'm the guy who wrote the comment in YouTube about this issue. Thanks for taking the time to report this issue. I have like 68 error messages like this in my project since I updated from 3.8.2 to 3.9.3 and have no clue on how to get rid of them ^_^U
from nuxt.
This appears to be an issue just with pick
as transform works fine (FWIW):
const { data } = useAsyncData(() => Promise.resolve({ data: { test: 1 } }), {
pick: ['data'],
// transform: data => data.data,
})
const test = computed(() => data.value?.test)
Looking to reproduce, this code (with pick
) has a type error all the way back to at least v3.6.0 in the Nuxt playground.
from nuxt.
I am not 100% sure if this applies to this issue. But I was able to resolve type errors in our project by explicitly pinning "vue": "3.4.15"
after upgrading Nuxt to 3.9.x.
from nuxt.
Start a new pull request in StackBlitz Codeflow.
from nuxt.
@danielroe Attached a repro (that I wanted to put there before, sorry) also showing transform issues I think.
from nuxt.
Would there be no way of having the useFetch return a globalThis.Ref (without using transform or pick) instead of Ref like before?
from nuxt.
https://nuxt.com/docs/getting-started/data-fetching#minimize-payload-size
Is the reproduction code misusing pick
?
pick: ['data']
and transform: data => ({ data: data.data })
operate similarly, but repro code seem to be expecting transform: data => data.data
.
const { data } = useAsyncData(
'key',
async () => {
return { data: { test: 1 }, foo: 'bar' }
},
{
pick: ['data'],
},
)
const test = computed(() => data.value?.foo) // Property 'foo' does not exist
const test = computed(() => data.value?.data.test) // works
from nuxt.
I am not 100% sure if this applies to this issue. But I was able to resolve type errors in our project by explicitly pinning
"vue": "3.4.15"
after upgrading Nuxt to 3.9.x.
Thanks! Pinning Vue 3.4.15 fixed the issue I was having as well.
from nuxt.
Related Issues (20)
- Compilation often leads to errors. HOT 1
- Custom page meta not available in layout HOT 4
- Hot Reload breaking on rename file (and change the path) HOT 1
- refreshCookie is currently not exported externally
- updateTemplates internal server error: Failed to resolve import HOT 2
- nuxt3 project cannot be deployed on Github pages HOT 3
- sharedPrerenderData documentation section missing closing code block
- UseAsyncData section of documentation includes an extra 'i' in "Iit's..."
- FATAL ERROR: Ineffective mark-compacts near heap limit Allocation failed - JavaScript heap out of memory HOT 2
- UseState work after middleware during SSR HOT 2
- Can't the steps for updating the program in nuxt3 be updated without feeling it?
- Hydration class mismatch HOT 2
- How can I integrate testing in Nuxt.js with the "@sidebase/nuxt-auth" module?
- The page is rendered first with middleware when using Pinia HOT 4
- Add short "pcss" extension of postcss HOT 2
- Only URLs with a scheme in: file, data, and node are supported by the default ESM loader. Received protocol 'https:' HOT 2
- When the default_type of the nginx server is application/octet-stream, in manifest.js $fetch json return Blob type. m.matcher is undefined. HOT 2
- useAsyncData in middleware gives warning to use $fetch when changing route to the same pageComponent HOT 12
- Add isHydrating composable HOT 4
- Redirect property on route entry using pages:extend causes the app to break HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from nuxt.