viandwi24 / nuxt3-awesome-starter

a Nuxt 3 template and boilerplate with a lot of useful features. Nuxt 3 + Tailwindcss + Nuxt Layer
https://nuxt3-awesome-starter.vercel.app
1.69k stars 361 forks source link

Vscode bug on pages #49

Closed florealcab closed 1 year ago

florealcab commented 1 year ago

On pages inside a subfolder of pages folder (example: pages/post/index.vue) I have a bug with VScode: it says composables functions are not defined, and an error with the import, see the image below: image

Do you have the same problem? It's a problem I have with my project too, and I didn't find a fix :/

viandwi24 commented 1 year ago

have you run the program using "pnpm dev"?

viandwi24 commented 1 year ago

have you run the program using "pnpm dev"?

florealcab commented 1 year ago

I didn't, so I run in console then the bug disapears :o

But why? I have another project I installed with yarn and "yarn dev" did not fix that bug. Do you add something in this app cause pnpm dev fix the issue, or it's just pnpm?

florealcab commented 1 year ago

Oh ah no, if I do yarn dev, then reopen vscode it works again... seems to be a nuxt strange issue so I can close

viandwi24 commented 1 year ago

as I wrote in the readme,

this project was created using pnpm, because pnpm has a different working concept than yarn and npm so it might cause problems if not using pnpm in projects that use pnpm.

viandwi24 commented 1 year ago

and this is actually a type problem.

nuxt typescript of course uses the types definition, and it will only be generated when you have run the program using "pnpm dev" because of our need for development.

the dev command will run nuxt and automatically generate types in the ".nuxt" folder.

if this folder does not exist, then this project will certainly display error problems, namely types are not defined in various functions.

viandwi24 commented 1 year ago

or you can use "npx nuxi prepare" for only generate types. image