-
-
Notifications
You must be signed in to change notification settings - Fork 125
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
There is a compatibility issue with "moduleResolution": "NodeNext" in TS #110
Comments
Same here, would love to find a solution 👀 |
Hey! Could you provide a link to a project/repo reproducing the issue so I can take a look? |
|
For me types imported from Otherwise, the imports inside Related change: #89 |
Has anyone found a workaround for this issue (that doesn't require reverting back to CommonJS or modifying content within the node_modules directory)? I've been using ts-pattern 3.3.5 in order to maintain the ability to have type information (and code completion) available while coding in VSCode. |
I tried updating ts-pattern's package.json to follow microbundle's recommendation to support NodeNext, but it doesn't seem to be working when cloning this test repo... Here is the PR if somebody wants to take a look: #136 The updated version is published as |
Typescript 5 was just released and has a new https://devblogs.microsoft.com/typescript/announcing-typescript-5-0/#moduleresolution-bundler |
Using This project's typings are broken if using |
USE AT YOUR OWN RISK: I've barely tested and only sort of know what I'm doing. I wouldn't be surprised if something is wonky but all I did was change the import paths and updated some of the tsconfig.json and package.json For anyone dealing with this who wants a hacky solution they can just install and move on from, you can use the git repo below https://github.com/mjsampson/ts-pattern-nodenext To install add The only things I did were
I'm curious what's blocking ts-pattern from implementing this change completely, my naive guess is the library is tied to jest which makes full esm migration more tricky? it builds and runs in staging for me, I've committed to esm modules with my codebase so if I hit another hitch with ts-pattern I'm just gonna have to find a replacement unless this issue gets resolved, but so far this is allowing me to use it with nodenext module resolution edit: fixed some grammar |
Checks against
Whatever was changed in the test release is better but not perfect. |
After many iterations, I think I finally have a version that works with nodenext + commonjs modules: #160 https://arethetypeswrong.github.io/?p=ts-pattern%404.2.4-test.1 I tested it locally and it seems to be working, but It would be very helpful if you could try to install |
Describe the bug
Codemirror does not compile with typescript 4.8 when "module": "ESNext" and "moduleResolution": "NodeNext" in the tsconfig. Error:
In a few words, TS introduced new ways to publish and consume type definitions and TS files depending on if you code using ESM or Commonjs.
According to this, adding an
index.d.cts
does the trick. So I copy-pasted theindex.d.ts
and renamed it. Then I removedtypes
from thepackage.json
and it did not work.Versions
The text was updated successfully, but these errors were encountered: