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

Update TypeScript to 4.2+ #5598

Closed
acd02 opened this issue Mar 18, 2021 · 11 comments
Closed

Update TypeScript to 4.2+ #5598

acd02 opened this issue Mar 18, 2021 · 11 comments

Comments

@acd02
Copy link

acd02 commented Mar 18, 2021

🌈 Feature

Hello, would it be possible to bump the TS version used by the editor to 4.2+ please, to avoid some false positive errors to occur ^^

@andrasbacsai
Copy link
Contributor

Hey, could you please show us some false positive errors? IMO, downgrading is not a good option.

@acd02
Copy link
Author

acd02 commented Mar 24, 2021

Actually, I can't seem to be able to reproduce those errors 😅

But I was talking about upgrading, not downgrading (currently, the editor uses TS@4.1.2)

@andrasbacsai
Copy link
Contributor

Ah sorry, I misunderstood that. Ooops.

@satanTime
Copy link

There is a working project which fails on codesandbox: https://codesandbox.io/s/github/ng-mocks/examples?file=/src/test.spec.ts

The same project on SB works (but requires optional dependencies): https://stackblitz.com/github/ng-mocks/examples?file=src/test.spec.ts

@satanTime
Copy link

Aha, so in my case it was actually about core-js: 3.11.3 works correctly, 3.12.0 is broken.

@FossPrime
Copy link

FossPrime commented Oct 6, 2021

It's now getting seriously out of date... 4.5.0 adds support for node12/nodenext native module resolution... A huge deal for interoperability between CJS/ESM node code and ts code.

This is the Nov 18th, 2020 version CSB is using: https://github.com/Microsoft/TypeScript/tree/v4.1.2

This is creating lots of false positive UI errors not only in tsconfig, but throughout the code as imports can't resolve properly when the new tsconfig.json format is not supported.

I would consider this a bug, technically a breaking one.

@FossPrime
Copy link

FossPrime commented Oct 8, 2021

Here is a small sampling of the litter of false-positive flags that almost make me want to disable IDE type checking... these are caused when I use node12 in compilerConfig.module and/or moduleResolution. These errors don't occur on the up to date version of TypeScript that the container is actually running. As you can see in the terminal, TypeScript 4.5.0 compiles without errors or warnings:

Screenshot 2021-10-07 19 53 25
Screenshot 2021-10-07 19 50 11

Another one related to how TS 4.5 supports native .mjs loading... which some modules export whenever you turn on node ESM. Previously TS just ignored that for the most part... but with the node12/nodenext option set in compilerOptions.module... TS 4.1 breaks, TS 4.5 thrives.

Screenshot 2021-10-08 11 47 02

@JamesACS
Copy link
Contributor

JamesACS commented Nov 3, 2021

Hey @rayfoss - We've now pushed a fix for this - please could you confirm whether everything is working as expected now? :)

@Shakeskeyboarde
Copy link

Shakeskeyboarde commented Nov 3, 2021

Well, it's now using 4.4.4, which is nice. But it's still ignoring the version included in the dependencies/devDependencies. I think the long term solution would be to use that version, no?

Edit: Adding the tsdk to the workspace settings also doesn't work, because it says that the directory doesn't contain a tsserver.js file.

{
  "typescript.tsdk": "/sandbox/node_modules/typescript/lib"
}

or

{
  "typescript.tsdk": "./node_modules/typescript/lib"
}

@acd02
Copy link
Author

acd02 commented Dec 3, 2021

I think this issue can be closed, since TS has been upgraded to v4.4.4 👍

Now ofc, it would be even better if one could select the TS version of its choice, but it's discussed in #942

@JamesACS
Copy link
Contributor

JamesACS commented Dec 3, 2021

Thanks @acd02 - I've got being able to change the version as a feature request on our end as well :)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

7 participants