dai-shi / waku

⛩️ The minimal React framework
https://waku.gg
MIT License
3.91k stars 102 forks source link

Unloaded waku.config.ts when build && start in managed mode #665

Closed t6adev closed 3 weeks ago

t6adev commented 4 weeks ago

I noticed that waku.config.ts is not loaded in prod ( build and start ) when coding middleware in managed mode(File-based routing).

Reproduction

You can see the top page. (This is not expected behavior)

  1. pnpm create waku
  2. Add waku.config.ts as minimal (See below)
  3. pnpm build && pnpm start
// waku.config.ts
/** @type {import('waku/config').Config} */
export default {
  middleware: () => [], // Actually, we have to import `waku/middleware/dev-server`, `waku/middleware/ssr` and `waku/middleware/rsc` as normal
};

For clarification, you can see a blank page if you run pnpm dev. (This is the expected behavior)

Note

However, the 08_cookies of examples is correctly working.

dai-shi commented 3 weeks ago

However, the 08_cookies of examples is correctly working.

Does it work if you pnpm create --choose and choose 08_cookies?

t6adev commented 3 weeks ago

Yes, it does.

And it was my fault. When applying middleware, I didn't realize that a page should be set in dynamic render mode. I was confused that dev mode can run middleware, so I'm sorry for bothering you.