nuxt / bridge

🌉 Experience Nuxt 3 features on existing Nuxt 2 projects
MIT License
273 stars 29 forks source link

`.nuxt/tsconfig.json` not generated on bridge #283

Closed antfu closed 2 years ago

antfu commented 2 years ago

Environment


Describe the bug

.nuxt/tsconfig.json not generated on nuxt and nuxt generate

Reproduction

https://github.com/antfu/vitesse-nuxt

Additional context

If I run npx nuxi prepare the following error is thrown

 FATAL  [nitro] Please use nuxt generate for static target                                          16:13:27

  at setupNitroBridge (node_modules/.pnpm/@nuxt+bridge-edge@3.0.0-27255596.0c1860a/node_modules/@nuxt/bridge-edge/dist/chunks/module.mjs:130:11)

Meanwhile, if I comment out target: 'static' it works fine and tsconfig.json got generated

Logs

No response

danielroe commented 2 years ago

You need to use nuxi command to trigger generation of tsconfig.json, which also means it won't be generated with nuxt generate. Could you try nuxi dev and see if it is created?

antfu commented 2 years ago

Ah, yes nuxi dev works.

pi0 commented 2 years ago

What about changing nuxi generate error to exec(nuxt, ...args) by checking the current nuxt version?

danielroe commented 2 years ago

I would suggest changing nuxt -> nuxi everywhere in docs and starter templates, and completely agree with @pi0 suggestion 👍

pi0 commented 2 years ago

In addition to nuxt/framework#1577 i guess we have to call writeTypes on nuxt instance and close it before exec 🙈