ParadoX
ParadoX
NNuxt
Created by ParadoX on 9/6/2024 in #❓・help
Typecheck errors on all that is auto imported
I switched from yarn to pnpm and now I am getting errors when running typecheck (vue-tsc) - it looks like every auto imported item is throwing the same error, example:
Property 'ROUTES' does not exist on type 'CreateComponentPublicInstanceWithMixins<Readonly<{}> & Readonly<{}>
Property 'ROUTES' does not exist on type 'CreateComponentPublicInstanceWithMixins<Readonly<{}> & Readonly<{}>
I have hunderds of the same kind...Any ideas?  🤔
3 replies
NNuxt
Created by ParadoX on 8/9/2024 in #❓・help
How to create a stateful composable that uses useState?
So I am refactoring my app and I am replacing pinia stores with composables. If I want a global state that is shared with all instances of that composable, I need to define this ref outside of the exported function. Like this:
const globalState = ref();
export default () => {
// [...]
return {
// [...]
state: readonly(globalState),
};
}
const globalState = ref();
export default () => {
// [...]
return {
// [...]
state: readonly(globalState),
};
}
However, if I want to use useState, I cannot do that outside of the composable function. What now? 🤔
9 replies
NNuxt
Created by ParadoX on 8/9/2024 in #❓・help
How to implement global error handling for useAsyncData?
1 replies
NNuxt
Created by ParadoX on 7/10/2024 in #❓・help
How can I use my own composables inside a playwright test?
I replaced pinia with a custom composable "useSettings". In my playwright tests, I was able to access Pinia like this
window.__NUXT__?.pinia.myStore
window.__NUXT__?.pinia.myStore
Now when I try to use my composable inside my tests, I am getting the error "useSettings is not defined". How can I import it? 🤔
1 replies