2020-03-17
2442
#nuxtjs#typescript
Preetish HS
15712
Mar 17, 2020 â‹… 8 min read

How to set up and code Nuxt.js apps fully in TypeScript

Preetish HS Freelance web developer, digital nomad, and design enthusiast. You can find me online at preetish.in.

Recent posts:

Rust logo over black marble background.

Handling memory leaks in Rust

Learn how to manage memory leaks in Rust, avoid unsafe behavior, and use tools like weak references to ensure efficient programs.

Ukeje Goodness
Nov 20, 2024 â‹… 4 min read
Robot pretending to be a person.

Using curl-impersonate in Node.js to avoid blocks

Bypass anti-bot measures in Node.js with curl-impersonate. Learn how it mimics browsers to overcome bot detection for web scraping.

Antonello Zanini
Nov 20, 2024 â‹… 13 min read
Solving Eventual Consistency In Frontend

Solving eventual consistency in frontend

Handle frontend data discrepancies with eventual consistency using WebSockets, Docker Compose, and practical code examples.

Kayode Adeniyi
Nov 19, 2024 â‹… 6 min read
How To Use Lazy Initialization Pattern With Rust 1.80

How to use the lazy initialization pattern with Rust 1.80

Efficient initializing is crucial to smooth-running websites. One way to optimize that process is through lazy initialization in Rust 1.80.

Yashodhan Joshi
Nov 18, 2024 â‹… 5 min read
View all posts

10 Replies to "How to set up and code Nuxt.js apps fully in TypeScript"

  1. Preetish many thanks for this, great post! How I can work with functional components and JSX in this mode? thanks!

  2. Using actions similar to mutations gives out an `ERR_ACTION_ACCESS_UNDEFINED` error. Tried researching online but no luck. Anything wrong that I’m doing here ?

  3. I ran following command
    npm run build

    which generated .nuxt folder when I tried to run that using “node server.js”, it gives me following error.

    C:\Users\Meera\Downloads\nuxt-typescript-example-master\nuxt-typescript-example-master\.nuxt\server.js:1
    import Vue from ‘vue’
    ^^^^^^

    SyntaxError: Cannot use import statement outside a module
    at wrapSafe (internal/modules/cjs/loader.js:979:16)
    at Module._compile (internal/modules/cjs/loader.js:1027:27)
    at Object.Module._extensions..js (internal/modules/cjs/loader.js:1092:10)
    at Module.load (internal/modules/cjs/loader.js:928:32)
    at Function.Module._load (internal/modules/cjs/loader.js:769:14)
    at Function.executeUserEntryPoint [as runMain] (internal/modules/run_main.js:72:12)
    at internal/main/run_main_module.js:17:47

Leave a Reply