pmarie
pmarie4w ago

Getting file:///src/src/server/schema path doubling error on Deno Deploy

😩 Hi! I'm deploying a Hono app to Deno Deploy and getting a persistent path resolution error where src/ is being doubled: Module not found "file:///src/src/server/schema" My setup: Hono v4 from JSR (jsr:@hono/hono@^4.10.1) Deploying via GitHub Actions to Deno Deploy Using path aliases in deno.json again, the error: When it tries to resolve imports inside my route files (like @/server/schema), it becomes file:///src/src/server/schema. I've tried different alias configurations ("@/": "./src/", "@/": "./", specific "@/server/" mappings) but keep getting the same src/src/ doubling. Any ideas what could be causing the path to double like this?
2 Replies
marvinh.
marvinh.4w ago
The double src is not the issue. Deno Deploy creates a src folder where user code runs in. The problem is that the path is lacking an extension. ESM requires a file extension. So the fix is doing something like this in your code:
- import schema from "@/server/schema";
+ import schema from "@/server/schema.ts";
- import schema from "@/server/schema";
+ import schema from "@/server/schema.ts";
pmarie
pmarieOP4w ago
im going to try this. thank you! that did not work, unfortunately 🙁

Did you find this page helpful?