-
Notifications
You must be signed in to change notification settings - Fork 17
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
Issue importing local TS files from entry #21
Comments
I'm having the same issue. It seems that the Like if you have the api located in: anyway is not a good solution, i know |
the kinda solution is to put main.ts (the file where defineRoutes is called) in the project root. This automatically makes your imports "from root". |
@smnbbrv Hi! I'd like to use your tip, but the problem seems to resurface as soon as a relative import is used, so it is hard to modularize any serious fastify related code used from this entry point. |
+1 for a fix for this. Such a great dev experience having HMR! |
I don't understand this issue. Are you all passing a URL to |
I've attached a minimal recreation for you here. But basically to recreate the issue I:
Archive.zip |
Thanks for the reproduction! I'm not sure what would cause this, but I think I have a good idea to fix it either way. |
I've looked into this a bit but haven't been able to figure it out yet. Inside Vite it seems to resolving these modules without providing the parent module to resolve relative, and I'm not sure why it's doing that. Will keep you updated. |
thank you @matthewp ! |
I am unable to find any related issue in the vite repo, and while trying to create a minimal reproduction using Could this be related to astro's vite config or at astro level? or can someone link me to an existing issue? or should i file one in astro and see where that goes? Trying to move to astro at work but this import issue is the only blocker for a week. thanks for this adapter & astro tho :) |
The following is the code my entry points to:
All the local imports fail with:
Do you know what's happening?
The text was updated successfully, but these errors were encountered: