nitrojs / nitrojs/nitro

Server side fetch during dev and production runs different

Open
#4,500 1 comment 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

bug v3
Dominant language
TypeScript
Stars
11.2k
Forks
899
Avg merge
2d 24m
Merged PRs (30d)
40

Description

Environment

nodejs

Reproduction

https://stackblitz.com/edit/github-yjfey7sb?file=server%2Froutes%2Findex.ts

Describe the bug

During development the the server side fetch can not resolve files in the public directory.

Once the app is build the server side fetch can resolve the public files and everything works as expected

Additional context

This was found in nuxt: https://github.com/nuxt/nuxt/issues/13857

Logs

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start with the StackBlitz reproduction and its server/routes/index.ts entry point, comparing the server-side fetch behavior during development and after a production build. Trace how public-directory files are resolved in each mode; done means the same fetch resolves those files in both development and production.

Written by the indexing model from the issue text.

Assessment

Tech stack
nodejs, typescript
Domain
backend
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Quiet
Clarity
Mostly clear
Newbie friendliness
55/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.