-
Notifications
You must be signed in to change notification settings - Fork 58
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
Unable to import in TS project with "moduleResolution": "NodeNext", #198
Comments
Will be potentially fixed in #199 |
@cyberwombat can you test it with #199 fixes? |
I think still an issue, additionally it looks like What I currently have to do to make it work:
Here's my tsconfig:
TS: 4.8.4 |
Fixed in the last commit, please check if you find other issues |
That fixed the
|
@cyberwombat can I see what you are extending I was able to use import S, { FluentSchemaError, ExtendedSchema } from "..";
console.log("isFluentSchema:", S.object().isFluentJSONSchema);
const schema = S.string() If we find out what is happening would be nice to reproduce inside the |
@cesarvspr |
I was able to use you provided tsconfig.json file and my own which is {
"compilerOptions": {
"useUnknownInCatchVariables": false,
"target": "es2020",
"lib": ["es2020"],
"module": "node16",
"moduleResolution": "NodeNext",
}
}
here you can see my test: |
You need |
you are right @cyberwombat, but I could not find a solution for this specific case yet. Btw, why are you using the |
I am migrating to 100% esm and that's part of the jump. If I don't then my code stays CJS when imported. I don't know of a solution except to build as both esm and cjs and using the |
@climba03003 Would you please help with this? I have a PR ready that just needs to work when we have "type":"module" on the package.json |
Prerequisites
Fastify version
NA
Plugin version
4.0.0
Node.js version
16.17
Operating system
macOS
Operating system version (i.e. 20.04, 11.3, 10)
12.4
Description
I am updating my TS code to use ESM which requires having
"moduleResolution": "NodeNext"
or"moduleResolution": "Node16"
. In doing so my code (whether I useimport S...
orimport * as S....
now gives me errors when I do:S.object()
orS.string()
etc with:I can provide a sample repo but I think if you just add `"moduleResolution": "NodeNext"`` to any TS sample it should do it.
Steps to Reproduce
Use `"moduleResolution": "NodeNext"`` in a TS project
Expected Behavior
No response
The text was updated successfully, but these errors were encountered: