Unclear how to use nuxt 2.9 programmaticly with typescript
See original GitHub issueWhat problem does this feature solve?
Hello, I use nuxt 2.8 with typescript and koa, so far I was able to get things to work using
cross-env NODE_ENV=development ts-node-dev -P ./server/tsconfig.json --transpile-only server/index.ts --watch server
for my dev script
and nuxt build && tsc -p ./server/
for my build script
With nuxt 2.9 I have to use nuxt-ts to make nuxt compile my vuex modules, if I dont I get this error:
[vuex] module namespace not found in mapGetters():
But if I use nuxt-ts then my server wont run, how am I suppose to do this correctly?
What does the proposed changes look like?
Add some documentation about running nuxt problematically.
<div align="right">This feature request is available on Nuxt community (#c9844)</div>Issue Analytics
- State:
- Created 4 years ago
- Reactions:4
- Comments:11
Top Results From Across the Web
Setup - Nuxt TypeScript
Check official TypeScript documentation to learn about the different compiler options. If you are using Nuxt programmatically with a custom server framework, ...
Read more >Run Nuxt 3 programmatically - typescript - Stack Overflow
First of all, I recommend using @nuxt/kit for this purpose as nuxt 3 is not providing the same way as nuxt 2 in...
Read more >Power a Nuxt application with TypeScript | by Alain Seng
Nuxt recently (January 2019) released the 2.4.0 version pushing ... From Nuxt 2.9 and on-ward, please use the official TypeScript support of Nuxt: ......
Read more >Nuxt, Next, Nest! Confused? - Codersera
js is a framework for building efficient, scalable Node.js server-side applications. It is the modern JavaScript, which is built with TypeScript and uses...
Read more >Use TypeScript on Nuxt.js from v2.5 | by Kengo Hamasaki / hmsk
To have typings for Nuxt-ish things for example asyncData , fetch on the components. Add @nuxt/vue-app (provided by @nuxt/typescript npm module) ...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
Programmatic usage is documented, but not for TypeScript. Overall all internals of nuxt aren’t typed, which means
Nuxt
&Builder
classes are not easy to use (you need to@ts-ignore
). See https://github.com/nuxt/typescript/issues/44Overall it add complexity and people asking for help, meanwhile more convenient solutions may/must fit your use cases.
I highly recommend a blog post from one of our core team members @manniL : https://blog.lichter.io/posts/nuxt-with-an-api
Having your server both delivering vue app & serving api means you’re limiting your application to be a Monolith, which in other means : one single block, indivisible, slow/hard to change.
Separating your frontend (Nuxt) and your backend (API) makes thing easier in several fields :
There are probably many other advantages but won’t enumerate all.
Still, Nuxt programmatic usage can answer to some use cases i’m not aware of OR not experienced in.
Closed by #233