Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Typescript 3.9 support #357

Closed
negezor opened this issue May 14, 2020 · 6 comments · Fixed by #366
Closed

Typescript 3.9 support #357

negezor opened this issue May 14, 2020 · 6 comments · Fixed by #366
Assignees
Labels
dependencies Pull requests that update a dependency file feature request Feature request

Comments

@negezor
Copy link

negezor commented May 14, 2020

Describe the bug
After upgrading to TypeScript 3.9.2, Nuxt.js can't resolve modules. Error looks like:

This dependency was not found:

* nuxt_plugin_compositionapi_1a0c1998 in ./.nuxt/index.js

However, even if you disable the plugins, it can't build .vue files.

Additional context
If you downgrade to 3.8.3, then everything works.

@opgbaudouin
Copy link

opgbaudouin commented May 14, 2020

Indeed this is the case - @nuxt/typescript-build has a dependency of "~3.8".
There are a LOT of issues with TS 3.9.x as they made subtle changes to how import works. In our case this was related to a 'broken' TSLIB being includes. AFAIK Nuxt uses it's own resolver and might not be compatible (yet).

related links: microsoft/tslib#109

@kevinmarrec
Copy link
Contributor

TypeScript minor releases often break projects, it has been the case of Vue.js types few times.

That's why I pinned Nuxt TypeScript packages to a specific TypeScript minor version.

TypeScript 3.9 is pretty new, and if you check their releases, 3.9.0 & 3.9.1 have only been respectively Beta & Release Candidate (RC) versions.

So official release of 3.9 is 3.9.2 which is only 2 days old.

I'd recommend to not install 3.9 for now, cause we don't know how big is the impact of the 3.9.2 changes regarding imports.

@negezor
Copy link
Author

negezor commented May 14, 2020

I use the monorepo approach, server build has actually become faster. But my front-end also depends of TypeScript. This is the only reason I'm waiting for this release. Then it remains only to wait.

@opgbaudouin
Copy link

I use the monorepo approach, server build has actually become faster. But my front-end also depends of TypeScript. This is the only reason I'm waiting for this release. Then it remains only to wait.

We also have monorepo with api / nuxt / other. we compile api with 3.9.2 , nuxt with 3.8.3. no issue as source code is same / shared. Based on looking at all the issues being reported with 3.9.2 doesn't suprise me kevin is waiting a bid to spent time on it...

@kevinmarrec kevinmarrec self-assigned this May 25, 2020
@kevinmarrec kevinmarrec added dependencies Pull requests that update a dependency file feature request Feature request labels May 25, 2020
@fboudra
Copy link

fboudra commented Jun 2, 2020

fwiw, it can happen that you have typescript 3.9 pulled by another dependency. I had an hello world experience with nuxt broken out of the box simply because I ended with typescript package 3.9.3 in my project node_modules. Simply create-nuxt-app, tried to run dev and got "Module not found: Error: Can't resolve 'ts-loader'".

It took me some time to figure out that @nuxt/typescript-build depends explicitely on typescript <= 3.9 and I had to pin to [email protected] .

@opgbaudouin
Copy link

fwiw, it can happen that you have typescript 3.9 pulled by another dependency. I had an hello world experience with nuxt broken out of the box simply because I ended with typescript package 3.9.3 in my project node_modules. Simply create-nuxt-app, tried to run dev and got "Module not found: Error: Can't resolve 'ts-loader'".

It took me some time to figure out that @nuxt/typescript-build depends explicitely on typescript <= 3.9 and I had to pin to [email protected] .

Working with node i make sure every package (that i control) is set to specific version - cannot rely on everyone to ensure the semantic versioning actually works :)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
dependencies Pull requests that update a dependency file feature request Feature request
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants