Closed apottere closed 5 months ago
Hi there, thanks for raising this.
Do you think this can be replicated in https://runkit.com/ ? Or would it need to be in a project.
I am wondering though, given Node 16 had it's EOL brought forward by 7 months due to potential vulnerabilities, should we actually by dropping support for node 16?
I haven't used runkit before but I'll take a look.
The node16
module resolution name is confusing. It isn't the module resolution for node 16, it's the module resolution compatible with the changes introduced in node 16. Per the docs:
'node16' or 'nodenext' for modern versions of Node.js. Node.js v12 and later supports both ECMAScript imports and CommonJS require, which resolve using different algorithms. These moduleResolution values, when combined with the corresponding module values, picks the right algorithm for each resolution based on whether Node.js will see an import or require in the output JavaScript code.
As of now, node16
is the most up-to-date value for moduleResolution
(not including bundler
of course).
It looks like there's no way to fiddle with builds in runkit, so I create a minimal reproduction here: https://github.com/apottere/ajv-typescript-node16
I see, I will take a look, thanks.
any updates on this?
This should be fixed by #2365. Can you try @benasher44/ajv
? I published that PR there
Looks good in https://arethetypeswrong.github.io/?p=%40benasher44%2Fajv%408.12.1 and seems to resolve the issue in my reproduction 👍
Interesting tool @apottere, it does indeed look all green.
This is compared with what we currently have
I'll just check it out a bit more, but looking good 👍
When can we expect the fix to be in? Thanks
Also seeing this same issue in my code. The error I'm seeing is in resolve.ts, the following two imports:
import * as equal from "fast-deep-equal"
import * as traverse from "json-schema-traverse"
can be minimally rewritten as
import equal from "fast-deep-equal"
import traverse from "json-schema-traverse"
to get it to compile (though I haven't tested if it actually works that way).
Right now I'm having to manually copy a significant amount of code from one of our internal libraries into another project because the node16 module resolution features are broken by this issue
Can you try the new version v8.13.0
?
What version of Ajv are you using? Does the issue happen if you use the latest version? 8.12.0
Your code
What results did you expect? No TS error is thrown.
Actual result:
I saw https://github.com/ajv-validator/ajv/issues/2204, but it doesn't look like it was resolved in that issue. This is an issue with how ajv exports its types: https://arethetypeswrong.github.io/?p=ajv%408.12.0
I can provide a reproduction in a sample project but it should be fairly easy to reproduce.