-
Notifications
You must be signed in to change notification settings - Fork 213
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
getting random 404s #628
Comments
Hi, dear @juliusmarminge. First, THANK YOU for spending time to make proper reproduction and write description and nice work in I have did little investigation to find a simple fix! ~> pingdotgg/uploadthing#573 Some more context: H3 router by default is in non-preemptive mode (see #194 and #183 -- it is to allow multiple routers) but in Nitro, the router is preemptive because we can safely assume it for top-level router (unjs/nitro#1504). When router is in non-preemptive mode and an event handler returns an Also I think if you like, we might introduce an UnStorage provider for upload thing! I think it would make usage much more ergonomic for Nitro/Nuxt users! ~> unjs/unstorage#389 Best! |
Environment
Reproduction
https://github.com/pingdotgg/uploadthing/tree/h3-debug
https://github.com/pingdotgg/uploadthing/blob/h3-debug/examples/backend-adapters/server/src/h3.ts
Describe the bug
I have noticed a random 404 error when fetching from itself, i.e.
/api/uploadthing
fetches/api/uploadthing
on the same server. We use this for our dev webhook but it seems to fails for some reason...To reproduce, checkout the repo and the linked branch,
pnpm i
,pnpm build
,cd examples/backend-adapters
and run the h3 example usingpnpm dev:h3
. This starts a vite server up at port 5173 as well as a listhen instance on port 3000 with the h3 app.Attempt to upload an image, and wait for the 404 to show up.
I also added a simple nitro server that you can compare to (run using
pnpm dev:nitro
), which works out of the box without issues. Maybe I have configured the h3 app wrong?Additional context
I also tried using a "raw" node.js server to eliminate listhen as the possible cause of error but that had the same behavior
Running the h3 app
CleanShot.2024-01-23.at.17.02.38.mp4
Running Nitro for comparison
CleanShot.2024-01-23.at.17.04.23.mp4
Logs
No response
The text was updated successfully, but these errors were encountered: