-
Notifications
You must be signed in to change notification settings - Fork 5.5k
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
multiple NPM compatibility issues #27894
Comments
skip when deno has compatibility issues with packages: denoland/deno#27894
Yeah, it would be good to do that, but just as separate issues (I don't think sub-issues is necessary). For exmaple, the first report within this issue is not a bug. The same thing happens in Node:
|
Second one, not a bug:
|
Well, it works in node but doesn't in Deno. also node version uses CJS.
same as first one, it runs in node. |
That's from a file considered to be commonjs. If you change that file to ESM it won't work (ex. open up a blank project and create a .mjs file and try importing it). |
From what I can tell from a glance, most of these are not issues. It's just how ESM importing CJS works in Node compat/Node. Try putting doing these imports from an
Deno has a bit of incompatibility with TypeScript files in Node projects because TypeScript emits imports/exports as |
The last one does seem like a bug though. I opened #27898 (again, if you notice a difference between Node in .mjs files and Deno with any of these then please let me know. There's a lot in this issue) |
Jetschema (wrong types https://arethetypeswrong.github.io/?p=jet-schema%401.4.3):
Jointz (wrong types https://arethetypeswrong.github.io/?p=jointz%407.0.4):
Going to close this one, but let me know if I missing something. |
related #26652 |
skip when deno has compatibility issues with packages: denoland/deno#27894
Version: Deno 2.1.9
All encountered while testing moltar/typescript-runtime-type-benchmarks#1267. might split into sub-issues later, but github UI doesn't seem to support creating them all at once
Reproduction Environment
deno repl --no-lock --unstable-sloppy-imports --unstable-detect-cjs
Directory imports
fp-ts
https://github.com/moltar/typescript-runtime-type-benchmarks/blob/606269200dd5432bf5c9f20aeee875a264adbc05/cases/io-ts.ts
r-assign
https://github.com/moltar/typescript-runtime-type-benchmarks/blob/606269200dd5432bf5c9f20aeee875a264adbc05/cases/r-assign.ts
stnl
https://github.com/moltar/typescript-runtime-type-benchmarks/blob/606269200dd5432bf5c9f20aeee875a264adbc05/cases/stnl.ts#L1-L3
Default import doesn't work
jointz
https://github.com/moltar/typescript-runtime-type-benchmarks/blob/606269200dd5432bf5c9f20aeee875a264adbc05/cases/jointz.ts
jetSchema
https://github.com/moltar/typescript-runtime-type-benchmarks/blob/606269200dd5432bf5c9f20aeee875a264adbc05/cases/jet-schema.ts
i think default import should work given it has default export defined.
Module not found
ts-utils
https://github.com/moltar/typescript-runtime-type-benchmarks/blob/606269200dd5432bf5c9f20aeee875a264adbc05/cases/ts-utils.ts
Undefined properties
toi
https://github.com/moltar/typescript-runtime-type-benchmarks/blob/606269200dd5432bf5c9f20aeee875a264adbc05/cases/toi.ts
The text was updated successfully, but these errors were encountered: