-
Notifications
You must be signed in to change notification settings - Fork 26
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
upgrading to 4.0.0 #738
Comments
Hi there, This issue happens when CommonJS code tries to require ESM modules as stated in error message, I can guess that you're using Otherwise it will be quite helpful to know how you run your application and which dependencies you have |
Thank for you your answer. ts-node-dev --transpile-only --inspect=0.0.0.0:9229 -r dotenv/config -r tsconfig-paths/register --files src/server.ts also "ts-node": "^10.2.1",
"ts-node-dev": "^1.1.8", here is a more detailed error for this issue: change the requiring code to use import(), or remove "type": "module" from /usr/src/app/node_modules/fastify-decorators/package.json |
Can you try to run it with I just want to ensure if this issues related or not: wclr/ts-node-dev#212 and wclr/ts-node-dev#265 Meanwhile I will try to find out time slot to reproduce/fix your issue, probably will create corresponding example project :) |
Hi @cesarvspr It seems I've found your issue and most probably it's related to this one - dividab/tsconfig-paths#189 Can you try to run your code without Upd: in general it seems that |
The problem persists when using Do you think thats the same case of running with Thank you for your help. |
Well, finally I've released 4.0.0-next.2 which fixes issue with Fastify v4 installed (unfortunately I forgot to publish it to npm when first v4 alpha was released) With this version I've created small sample project with several scripts:
Sorry for some mess with registers, they're working as expected, I've ensured that they're working as expected, no problem. |
About nodemon example: https://github.com/comingAlive/typescript-nodemon-top-level-await-example/ |
Out of curiosity, is there anything in Fastify 4 that prevents v3 (this lib) from working correctly? I have lots of deps that (currently) make it impossible to move to esm only. |
Thank you for you release and reply @L2jLiga I've not been able to test is yet |
I'm pretty sure that there's nothing that prevent fastify-decorators v3 to work with v4. I'm currently testing this setup, most probably will create release soon |
Just released v3.12.0 with Fastify v4 support. |
Seems like it is working, but looks like that when upgrading, there is no way to set the typebuilder for typebox so it shows the error: I've used https://github.com/fastify/fastify-type-provider-typebox in projects that dont use fastify decorator, but I dont see a way to use this with fastify decorators |
There's currently 2 limitations which prevents type providers from work:
|
@L2jLiga Is this still the case? |
Hi @JacobWennebro, I tried to playaround with recent versions of TS, seems it's still an issue |
Just published v4.0.0-next.5 Main highlights:
Note: Experimental Decorators and ECMAScript Decorators are both working as of now, no changes needed on user-side (except for DI) Node 18+ and Typescript 5.2+ only |
I following the docs I can't see why I am getting this error.
Tried to follow the docs but it does not apply to my case.
The docs have:
My code
Logs
The text was updated successfully, but these errors were encountered: