Typescript: TypeScript 3.7 support

Created on 6 Nov 2019  路  22Comments  路  Source: nuxt/typescript

ts3.7.x
is released

have any plan to upgrade to 3.7 ?

feature request

Most helpful comment

Hi everyone, I'm back from vacation and will be focusing on this upgrade in the next days.
But maybe this issue could be a blocker : https://github.com/nuxt/typescript/issues/191, I need to check if it's still reproducible with 3.7.

All 22 comments

@dandanXO Yes, I'm just waiting to see if there is any issue using it with Vue, as 3.6 brought some issues (breaking Vue types) at the beginning. I had to rollback typescript version which was far from ideal.

Also : ts-loader / fork-ts-checker-webpack-plugin may not be totally compatible with 3.7 for now.

In my big project 3.7 just breaks it, it is not able to find my middleware file anymore :

image

@kevinmarrec let's see if update to ts 3.7 and ts-loader accordingly will fix our mysteroius issue with reloading :D

Will dive into it when back from vacations (I'm off computer since a week and coming back in another week). Has ts-loader been properly updated/fixed ?

For me, this works:

  • @babel/plugin-proposal-nullish-coalescing-operator 7.4.4
  • @babel/plugin-proposal-optional-chaining 7.6.0
  • @nuxt/typescript-runtime 0.2.4
  • @nuxt/typescript-build 0.3.4
  • ts-node 8.5.0
  • ts-loader 6.2.1
  • typescript 3.7.2

I also had to update ESLint to 6.6.0

But after adding all of those packages to our dev dependencies, and updating nuxt.config.js with the babel plugins, everything seems to be working!

I also need it.

Hi everyone, I'm back from vacation and will be focusing on this upgrade in the next days.
But maybe this issue could be a blocker : https://github.com/nuxt/typescript/issues/191, I need to check if it's still reproducible with 3.7.

I've also experienced some issues with type inference under 3.7 for nuxt-typed-vuex (#33), and I think it's to do with how this.$app is declared, so I'd be keen to investigate further and (ideally) help find a solution.

Yeah I want it to be 100% working to make the Nuxt TypeScript support targets 3.7.

Still people need to be aware they just need to install 3.7 in their project to use it now.

Still people need to be aware they just need to install 3.7 in their project to use it now.

This is probably only true if you don't use any 3.7 features, or am I missing something? I could only get nullish coalescing and optional chaining working with babel plugins and even then not for server middlewares.

I've a big Nuxt TypeScript project at work so I'll try to use 3.7 but last time I did I had unfixable issues so I'll first need to upgrade all TypeScript dependencies cause I was suspecting ts-loader and fork-ts-checker-webpack-plugin. Maybe upgrading everything except typescript one, release a new @nuxt/typescript-build version and manually upgrade locally to 3.7, would be the more suitable test.

I'm using 3.7 as well seems fine.

@chanlito Haven't you fallen into this issue : https://github.com/nuxt/typescript/issues/191 ?

Also, I tried again again my big Nuxt TS project and I just have the same issue I got earlier weeks ago :
Screenshot from 2019-12-01 13-12-38

Downgrading typescript to 3.6.x just work, so I've no clues about what's going on.

@kevinmarrec does it have to do with mixing js and ts? Why not make your middleware file in typescript?

It is in TypeScript. (authenticated.ts)

Whoops yea I was looking at the middleware.js my bad. Not sure then it seems to be working fine for me.

@kevinmarrec I haven't yet run into that issue.

Well it's the only issue I'm facing to properly upgrade to 3.7.

The reproduction should be simple as having a TypeScript plugin or a TypeScript middleware on my side, it makes Webpack build error (and being randomly plugin or middleware cause I supposed they're handled by Webpack asynchronously in parrallel)

@kevinmarrec See this repro - which builds without issue with a TS plugin.

Well I think the issue around plugins is if .ts extension omitted, still I've an issue with page TypeScript middlewares.

Was this page helpful?
0 / 5 - 0 ratings