Skip to content
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

fix(router): fallback support in new_defineRouter and new_createPages #1013

Merged
merged 20 commits into from
Nov 25, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
20 commits
Select commit Hold shift + click to select a range
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion e2e/broken-link.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ async function start(staticServe: boolean) {
]);

await waitPort({ port });
return [port, cp.pid];
return [port, cp.pid] as const;
}

test.beforeEach(async () => {
Expand Down
2 changes: 1 addition & 1 deletion e2e/ssr-catch-error.spec.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { expect } from '@playwright/test';

Check failure on line 1 in e2e/ssr-catch-error.spec.ts

View workflow job for this annotation

GitHub Actions / E2E on windows-latest (Node 22.7.0) - (1/4)

Child Process Error

stderr: [plugin:vite:reporter] [plugin vite:reporter] (!) D:/a/_temp/waku-ssr-catch-error-Mmz2Dv/node_modules/waku/dist/middleware/context.js is dynamically imported by D:/a/_temp/waku-ssr-catch-error-Mmz2Dv/node_modules/waku/dist/lib/config.js, D:/a/_temp/waku-ssr-catch-error-Mmz2Dv/waku.config.ts but also statically imported by D:/a/_temp/waku-ssr-catch-error-Mmz2Dv/node_modules/waku/dist/server.js, dynamic import will not move module into another chunk.

Check failure on line 1 in e2e/ssr-catch-error.spec.ts

View workflow job for this annotation

GitHub Actions / E2E on ubuntu-latest (Node 20.8.0) - (1/4)

Child Process Error

stderr: [plugin:vite:reporter] [plugin vite:reporter] (!) /home/runner/work/_temp/waku-ssr-catch-error-VwZaaF/node_modules/waku/dist/middleware/context.js is dynamically imported by /home/runner/work/_temp/waku-ssr-catch-error-VwZaaF/node_modules/waku/dist/lib/config.js, /home/runner/work/_temp/waku-ssr-catch-error-VwZaaF/waku.config.ts but also statically imported by /home/runner/work/_temp/waku-ssr-catch-error-VwZaaF/node_modules/waku/dist/server.js, dynamic import will not move module into another chunk.

Check failure on line 1 in e2e/ssr-catch-error.spec.ts

View workflow job for this annotation

GitHub Actions / E2E on ubuntu-latest (Node 22.7.0) - (1/4)

Child Process Error

stderr: [plugin:vite:reporter] [plugin vite:reporter] (!) /home/runner/work/_temp/waku-ssr-catch-error-0IHJQs/node_modules/waku/dist/middleware/context.js is dynamically imported by /home/runner/work/_temp/waku-ssr-catch-error-0IHJQs/node_modules/waku/dist/lib/config.js, /home/runner/work/_temp/waku-ssr-catch-error-0IHJQs/waku.config.ts but also statically imported by /home/runner/work/_temp/waku-ssr-catch-error-0IHJQs/node_modules/waku/dist/server.js, dynamic import will not move module into another chunk.

Check failure on line 1 in e2e/ssr-catch-error.spec.ts

View workflow job for this annotation

GitHub Actions / E2E on ubuntu-latest (Node 18.17.0) - (1/4)

Child Process Error

stderr: [plugin:vite:reporter] [plugin vite:reporter] (!) /home/runner/work/_temp/waku-ssr-catch-error-Ij7atF/node_modules/waku/dist/middleware/context.js is dynamically imported by /home/runner/work/_temp/waku-ssr-catch-error-Ij7atF/node_modules/waku/dist/lib/config.js, /home/runner/work/_temp/waku-ssr-catch-error-Ij7atF/waku.config.ts but also statically imported by /home/runner/work/_temp/waku-ssr-catch-error-Ij7atF/node_modules/waku/dist/server.js, dynamic import will not move module into another chunk.

Check failure on line 1 in e2e/ssr-catch-error.spec.ts

View workflow job for this annotation

GitHub Actions / E2E on macos-latest (Node 22.7.0) - (1/4)

Child Process Error

stderr: [plugin:vite:reporter] [plugin vite:reporter] (!) /Users/runner/work/_temp/waku-ssr-catch-error-m9jV1H/node_modules/waku/dist/middleware/context.js is dynamically imported by /Users/runner/work/_temp/waku-ssr-catch-error-m9jV1H/node_modules/waku/dist/lib/config.js, /Users/runner/work/_temp/waku-ssr-catch-error-m9jV1H/waku.config.ts but also statically imported by /Users/runner/work/_temp/waku-ssr-catch-error-m9jV1H/node_modules/waku/dist/server.js, dynamic import will not move module into another chunk.

Check failure on line 1 in e2e/ssr-catch-error.spec.ts

View workflow job for this annotation

GitHub Actions / E2E on ubuntu-latest (Node 22.7.0) - (2/4)

Child Process Error

stderr: [plugin:vite:reporter] [plugin vite:reporter] (!) /home/runner/work/_temp/waku-ssr-catch-error-BQj1fs/node_modules/waku/dist/middleware/context.js is dynamically imported by /home/runner/work/_temp/waku-ssr-catch-error-BQj1fs/node_modules/waku/dist/lib/config.js, /home/runner/work/_temp/waku-ssr-catch-error-BQj1fs/waku.config.ts but also statically imported by /home/runner/work/_temp/waku-ssr-catch-error-BQj1fs/node_modules/waku/dist/server.js, dynamic import will not move module into another chunk.

Check failure on line 1 in e2e/ssr-catch-error.spec.ts

View workflow job for this annotation

GitHub Actions / E2E on ubuntu-latest (Node 22.7.0) - (2/4)

Child Process Error

stderr: [plugin:vite:reporter] [plugin vite:reporter] (!) /home/runner/work/_temp/waku-ssr-catch-error-BTgcnN/node_modules/waku/dist/middleware/context.js is dynamically imported by /home/runner/work/_temp/waku-ssr-catch-error-BTgcnN/node_modules/waku/dist/lib/config.js, /home/runner/work/_temp/waku-ssr-catch-error-BTgcnN/waku.config.ts but also statically imported by /home/runner/work/_temp/waku-ssr-catch-error-BTgcnN/node_modules/waku/dist/server.js, dynamic import will not move module into another chunk.

Check failure on line 1 in e2e/ssr-catch-error.spec.ts

View workflow job for this annotation

GitHub Actions / E2E on ubuntu-latest (Node 20.8.0) - (3/4)

Child Process Error

stderr: [plugin:vite:reporter] [plugin vite:reporter] (!) /home/runner/work/_temp/waku-ssr-catch-error-0PQiXf/node_modules/waku/dist/middleware/context.js is dynamically imported by /home/runner/work/_temp/waku-ssr-catch-error-0PQiXf/node_modules/waku/dist/lib/config.js, /home/runner/work/_temp/waku-ssr-catch-error-0PQiXf/waku.config.ts but also statically imported by /home/runner/work/_temp/waku-ssr-catch-error-0PQiXf/node_modules/waku/dist/server.js, dynamic import will not move module into another chunk.

Check failure on line 1 in e2e/ssr-catch-error.spec.ts

View workflow job for this annotation

GitHub Actions / E2E on ubuntu-latest (Node 20.8.0) - (3/4)

Child Process Error

stderr: [plugin:vite:reporter] [plugin vite:reporter] (!) /home/runner/work/_temp/waku-ssr-catch-error-KPvKKZ/node_modules/waku/dist/middleware/context.js is dynamically imported by /home/runner/work/_temp/waku-ssr-catch-error-KPvKKZ/node_modules/waku/dist/lib/config.js, /home/runner/work/_temp/waku-ssr-catch-error-KPvKKZ/waku.config.ts but also statically imported by /home/runner/work/_temp/waku-ssr-catch-error-KPvKKZ/node_modules/waku/dist/server.js, dynamic import will not move module into another chunk.

Check failure on line 1 in e2e/ssr-catch-error.spec.ts

View workflow job for this annotation

GitHub Actions / E2E on ubuntu-latest (Node 20.8.0) - (3/4)

Child Process Error

stderr: [plugin:vite:reporter] [plugin vite:reporter] (!) /home/runner/work/_temp/waku-ssr-catch-error-JkDb83/node_modules/waku/dist/middleware/context.js is dynamically imported by /home/runner/work/_temp/waku-ssr-catch-error-JkDb83/node_modules/waku/dist/lib/config.js, /home/runner/work/_temp/waku-ssr-catch-error-JkDb83/waku.config.ts but also statically imported by /home/runner/work/_temp/waku-ssr-catch-error-JkDb83/node_modules/waku/dist/server.js, dynamic import will not move module into another chunk.

Check failure on line 1 in e2e/ssr-catch-error.spec.ts

View workflow job for this annotation

GitHub Actions / E2E on macos-latest (Node 22.7.0) - (2/4)

Child Process Error

stderr: [plugin:vite:reporter] [plugin vite:reporter] (!) /Users/runner/work/_temp/waku-ssr-catch-error-0sncoJ/node_modules/waku/dist/middleware/context.js is dynamically imported by /Users/runner/work/_temp/waku-ssr-catch-error-0sncoJ/node_modules/waku/dist/lib/config.js, /Users/runner/work/_temp/waku-ssr-catch-error-0sncoJ/waku.config.ts but also statically imported by /Users/runner/work/_temp/waku-ssr-catch-error-0sncoJ/node_modules/waku/dist/server.js, dynamic import will not move module into another chunk.

Check failure on line 1 in e2e/ssr-catch-error.spec.ts

View workflow job for this annotation

GitHub Actions / E2E on ubuntu-latest (Node 18.17.0) - (2/4)

Child Process Error

stderr: [plugin:vite:reporter] [plugin vite:reporter] (!) /home/runner/work/_temp/waku-ssr-catch-error-Zk6o5v/node_modules/waku/dist/middleware/context.js is dynamically imported by /home/runner/work/_temp/waku-ssr-catch-error-Zk6o5v/node_modules/waku/dist/lib/config.js, /home/runner/work/_temp/waku-ssr-catch-error-Zk6o5v/waku.config.ts but also statically imported by /home/runner/work/_temp/waku-ssr-catch-error-Zk6o5v/node_modules/waku/dist/server.js, dynamic import will not move module into another chunk.

Check failure on line 1 in e2e/ssr-catch-error.spec.ts

View workflow job for this annotation

GitHub Actions / E2E on macos-latest (Node 22.7.0) - (2/4)

Child Process Error

stderr: [plugin:vite:reporter] [plugin vite:reporter] (!) /Users/runner/work/_temp/waku-ssr-catch-error-xNuYCl/node_modules/waku/dist/middleware/context.js is dynamically imported by /Users/runner/work/_temp/waku-ssr-catch-error-xNuYCl/node_modules/waku/dist/lib/config.js, /Users/runner/work/_temp/waku-ssr-catch-error-xNuYCl/waku.config.ts but also statically imported by /Users/runner/work/_temp/waku-ssr-catch-error-xNuYCl/node_modules/waku/dist/server.js, dynamic import will not move module into another chunk.

Check failure on line 1 in e2e/ssr-catch-error.spec.ts

View workflow job for this annotation

GitHub Actions / E2E on ubuntu-latest (Node 18.17.0) - (2/4)

Child Process Error

stderr: [plugin:vite:reporter] [plugin vite:reporter] (!) /home/runner/work/_temp/waku-ssr-catch-error-QyPkYn/node_modules/waku/dist/middleware/context.js is dynamically imported by /home/runner/work/_temp/waku-ssr-catch-error-QyPkYn/node_modules/waku/dist/lib/config.js, /home/runner/work/_temp/waku-ssr-catch-error-QyPkYn/waku.config.ts but also statically imported by /home/runner/work/_temp/waku-ssr-catch-error-QyPkYn/node_modules/waku/dist/server.js, dynamic import will not move module into another chunk.

Check failure on line 1 in e2e/ssr-catch-error.spec.ts

View workflow job for this annotation

GitHub Actions / E2E on windows-latest (Node 22.7.0) - (2/4)

Child Process Error

stderr: [plugin:vite:reporter] [plugin vite:reporter] (!) D:/a/_temp/waku-ssr-catch-error-XPU3v8/node_modules/waku/dist/middleware/context.js is dynamically imported by D:/a/_temp/waku-ssr-catch-error-XPU3v8/node_modules/waku/dist/lib/config.js, D:/a/_temp/waku-ssr-catch-error-XPU3v8/waku.config.ts but also statically imported by D:/a/_temp/waku-ssr-catch-error-XPU3v8/node_modules/waku/dist/server.js, dynamic import will not move module into another chunk.

Check failure on line 1 in e2e/ssr-catch-error.spec.ts

View workflow job for this annotation

GitHub Actions / E2E on ubuntu-latest (Node 18.17.0) - (3/4)

Child Process Error

stderr: [plugin:vite:reporter] [plugin vite:reporter] (!) /home/runner/work/_temp/waku-ssr-catch-error-IQ0xMq/node_modules/waku/dist/middleware/context.js is dynamically imported by /home/runner/work/_temp/waku-ssr-catch-error-IQ0xMq/node_modules/waku/dist/lib/config.js, /home/runner/work/_temp/waku-ssr-catch-error-IQ0xMq/waku.config.ts but also statically imported by /home/runner/work/_temp/waku-ssr-catch-error-IQ0xMq/node_modules/waku/dist/server.js, dynamic import will not move module into another chunk.

Check failure on line 1 in e2e/ssr-catch-error.spec.ts

View workflow job for this annotation

GitHub Actions / E2E on windows-latest (Node 22.7.0) - (2/4)

Child Process Error

stderr: [plugin:vite:reporter] [plugin vite:reporter] (!) D:/a/_temp/waku-ssr-catch-error-ICfomM/node_modules/waku/dist/middleware/context.js is dynamically imported by D:/a/_temp/waku-ssr-catch-error-ICfomM/node_modules/waku/dist/lib/config.js, D:/a/_temp/waku-ssr-catch-error-ICfomM/waku.config.ts but also statically imported by D:/a/_temp/waku-ssr-catch-error-ICfomM/node_modules/waku/dist/server.js, dynamic import will not move module into another chunk.

Check failure on line 1 in e2e/ssr-catch-error.spec.ts

View workflow job for this annotation

GitHub Actions / E2E on ubuntu-latest (Node 18.17.0) - (3/4)

Child Process Error

stderr: [plugin:vite:reporter] [plugin vite:reporter] (!) /home/runner/work/_temp/waku-ssr-catch-error-OsSRaC/node_modules/waku/dist/middleware/context.js is dynamically imported by /home/runner/work/_temp/waku-ssr-catch-error-OsSRaC/node_modules/waku/dist/lib/config.js, /home/runner/work/_temp/waku-ssr-catch-error-OsSRaC/waku.config.ts but also statically imported by /home/runner/work/_temp/waku-ssr-catch-error-OsSRaC/node_modules/waku/dist/server.js, dynamic import will not move module into another chunk.

Check failure on line 1 in e2e/ssr-catch-error.spec.ts

View workflow job for this annotation

GitHub Actions / E2E on ubuntu-latest (Node 18.17.0) - (3/4)

Child Process Error

stderr: [plugin:vite:reporter] [plugin vite:reporter] (!) /home/runner/work/_temp/waku-ssr-catch-error-XUflwn/node_modules/waku/dist/middleware/context.js is dynamically imported by /home/runner/work/_temp/waku-ssr-catch-error-XUflwn/node_modules/waku/dist/lib/config.js, /home/runner/work/_temp/waku-ssr-catch-error-XUflwn/waku.config.ts but also statically imported by /home/runner/work/_temp/waku-ssr-catch-error-XUflwn/node_modules/waku/dist/server.js, dynamic import will not move module into another chunk.

Check failure on line 1 in e2e/ssr-catch-error.spec.ts

View workflow job for this annotation

GitHub Actions / E2E on ubuntu-latest (Node 22.7.0) - (3/4)

Child Process Error

stderr: [plugin:vite:reporter] [plugin vite:reporter] (!) /home/runner/work/_temp/waku-ssr-catch-error-XyV7un/node_modules/waku/dist/middleware/context.js is dynamically imported by /home/runner/work/_temp/waku-ssr-catch-error-XyV7un/node_modules/waku/dist/lib/config.js, /home/runner/work/_temp/waku-ssr-catch-error-XyV7un/waku.config.ts but also statically imported by /home/runner/work/_temp/waku-ssr-catch-error-XyV7un/node_modules/waku/dist/server.js, dynamic import will not move module into another chunk.

Check failure on line 1 in e2e/ssr-catch-error.spec.ts

View workflow job for this annotation

GitHub Actions / E2E on ubuntu-latest (Node 22.7.0) - (3/4)

Child Process Error

stderr: [plugin:vite:reporter] [plugin vite:reporter] (!) /home/runner/work/_temp/waku-ssr-catch-error-iOGbzG/node_modules/waku/dist/middleware/context.js is dynamically imported by /home/runner/work/_temp/waku-ssr-catch-error-iOGbzG/node_modules/waku/dist/lib/config.js, /home/runner/work/_temp/waku-ssr-catch-error-iOGbzG/waku.config.ts but also statically imported by /home/runner/work/_temp/waku-ssr-catch-error-iOGbzG/node_modules/waku/dist/server.js, dynamic import will not move module into another chunk.

Check failure on line 1 in e2e/ssr-catch-error.spec.ts

View workflow job for this annotation

GitHub Actions / E2E on ubuntu-latest (Node 22.7.0) - (3/4)

Child Process Error

stderr: [plugin:vite:reporter] [plugin vite:reporter] (!) /home/runner/work/_temp/waku-ssr-catch-error-fjdj45/node_modules/waku/dist/middleware/context.js is dynamically imported by /home/runner/work/_temp/waku-ssr-catch-error-fjdj45/node_modules/waku/dist/lib/config.js, /home/runner/work/_temp/waku-ssr-catch-error-fjdj45/waku.config.ts but also statically imported by /home/runner/work/_temp/waku-ssr-catch-error-fjdj45/node_modules/waku/dist/server.js, dynamic import will not move module into another chunk.

Check failure on line 1 in e2e/ssr-catch-error.spec.ts

View workflow job for this annotation

GitHub Actions / E2E on windows-latest (Node 22.7.0) - (3/4)

Child Process Error

stderr: [plugin:vite:reporter] [plugin vite:reporter] (!) D:/a/_temp/waku-ssr-catch-error-G75NLi/node_modules/waku/dist/middleware/context.js is dynamically imported by D:/a/_temp/waku-ssr-catch-error-G75NLi/node_modules/waku/dist/lib/config.js, D:/a/_temp/waku-ssr-catch-error-G75NLi/waku.config.ts but also statically imported by D:/a/_temp/waku-ssr-catch-error-G75NLi/node_modules/waku/dist/server.js, dynamic import will not move module into another chunk.

Check failure on line 1 in e2e/ssr-catch-error.spec.ts

View workflow job for this annotation

GitHub Actions / E2E on windows-latest (Node 22.7.0) - (3/4)

Child Process Error

stderr: [plugin:vite:reporter] [plugin vite:reporter] (!) D:/a/_temp/waku-ssr-catch-error-yGq21B/node_modules/waku/dist/middleware/context.js is dynamically imported by D:/a/_temp/waku-ssr-catch-error-yGq21B/node_modules/waku/dist/lib/config.js, D:/a/_temp/waku-ssr-catch-error-yGq21B/waku.config.ts but also statically imported by D:/a/_temp/waku-ssr-catch-error-yGq21B/node_modules/waku/dist/server.js, dynamic import will not move module into another chunk.

Check failure on line 1 in e2e/ssr-catch-error.spec.ts

View workflow job for this annotation

GitHub Actions / E2E on windows-latest (Node 22.7.0) - (3/4)

Child Process Error

stderr: [plugin:vite:reporter] [plugin vite:reporter] (!) D:/a/_temp/waku-ssr-catch-error-CLRQ58/node_modules/waku/dist/middleware/context.js is dynamically imported by D:/a/_temp/waku-ssr-catch-error-CLRQ58/node_modules/waku/dist/lib/config.js, D:/a/_temp/waku-ssr-catch-error-CLRQ58/waku.config.ts but also statically imported by D:/a/_temp/waku-ssr-catch-error-CLRQ58/node_modules/waku/dist/server.js, dynamic import will not move module into another chunk.

Check failure on line 1 in e2e/ssr-catch-error.spec.ts

View workflow job for this annotation

GitHub Actions / E2E on ubuntu-latest (Node 18.17.0) - (4/4)

Child Process Error

stderr: [plugin:vite:reporter] [plugin vite:reporter] (!) /home/runner/work/_temp/waku-ssr-catch-error-AIsJfM/node_modules/waku/dist/middleware/context.js is dynamically imported by /home/runner/work/_temp/waku-ssr-catch-error-AIsJfM/node_modules/waku/dist/lib/config.js, /home/runner/work/_temp/waku-ssr-catch-error-AIsJfM/waku.config.ts but also statically imported by /home/runner/work/_temp/waku-ssr-catch-error-AIsJfM/node_modules/waku/dist/server.js, dynamic import will not move module into another chunk.

Check failure on line 1 in e2e/ssr-catch-error.spec.ts

View workflow job for this annotation

GitHub Actions / E2E on ubuntu-latest (Node 18.17.0) - (4/4)

Child Process Error

stderr: [plugin:vite:reporter] [plugin vite:reporter] (!) /home/runner/work/_temp/waku-ssr-catch-error-9QGFnr/node_modules/waku/dist/middleware/context.js is dynamically imported by /home/runner/work/_temp/waku-ssr-catch-error-9QGFnr/node_modules/waku/dist/lib/config.js, /home/runner/work/_temp/waku-ssr-catch-error-9QGFnr/waku.config.ts but also statically imported by /home/runner/work/_temp/waku-ssr-catch-error-9QGFnr/node_modules/waku/dist/server.js, dynamic import will not move module into another chunk.

Check failure on line 1 in e2e/ssr-catch-error.spec.ts

View workflow job for this annotation

GitHub Actions / E2E on ubuntu-latest (Node 18.17.0) - (4/4)

Child Process Error

stderr: [plugin:vite:reporter] [plugin vite:reporter] (!) /home/runner/work/_temp/waku-ssr-catch-error-bNYrsQ/node_modules/waku/dist/middleware/context.js is dynamically imported by /home/runner/work/_temp/waku-ssr-catch-error-bNYrsQ/node_modules/waku/dist/lib/config.js, /home/runner/work/_temp/waku-ssr-catch-error-bNYrsQ/waku.config.ts but also statically imported by /home/runner/work/_temp/waku-ssr-catch-error-bNYrsQ/node_modules/waku/dist/server.js, dynamic import will not move module into another chunk.

Check failure on line 1 in e2e/ssr-catch-error.spec.ts

View workflow job for this annotation

GitHub Actions / E2E on windows-latest (Node 22.7.0) - (4/4)

Child Process Error

stderr: [plugin:vite:reporter] [plugin vite:reporter] (!) D:/a/_temp/waku-ssr-catch-error-LhEUv1/node_modules/waku/dist/middleware/context.js is dynamically imported by D:/a/_temp/waku-ssr-catch-error-LhEUv1/node_modules/waku/dist/lib/config.js, D:/a/_temp/waku-ssr-catch-error-LhEUv1/waku.config.ts but also statically imported by D:/a/_temp/waku-ssr-catch-error-LhEUv1/node_modules/waku/dist/server.js, dynamic import will not move module into another chunk.

Check failure on line 1 in e2e/ssr-catch-error.spec.ts

View workflow job for this annotation

GitHub Actions / E2E on windows-latest (Node 22.7.0) - (4/4)

Child Process Error

stderr: [plugin:vite:reporter] [plugin vite:reporter] (!) D:/a/_temp/waku-ssr-catch-error-ucBZzb/node_modules/waku/dist/middleware/context.js is dynamically imported by D:/a/_temp/waku-ssr-catch-error-ucBZzb/node_modules/waku/dist/lib/config.js, D:/a/_temp/waku-ssr-catch-error-ucBZzb/waku.config.ts but also statically imported by D:/a/_temp/waku-ssr-catch-error-ucBZzb/node_modules/waku/dist/server.js, dynamic import will not move module into another chunk.

Check failure on line 1 in e2e/ssr-catch-error.spec.ts

View workflow job for this annotation

GitHub Actions / E2E on windows-latest (Node 22.7.0) - (4/4)

Child Process Error

stderr: [plugin:vite:reporter] [plugin vite:reporter] (!) D:/a/_temp/waku-ssr-catch-error-EKCS4j/node_modules/waku/dist/middleware/context.js is dynamically imported by D:/a/_temp/waku-ssr-catch-error-EKCS4j/node_modules/waku/dist/lib/config.js, D:/a/_temp/waku-ssr-catch-error-EKCS4j/waku.config.ts but also statically imported by D:/a/_temp/waku-ssr-catch-error-EKCS4j/node_modules/waku/dist/server.js, dynamic import will not move module into another chunk.

Check failure on line 1 in e2e/ssr-catch-error.spec.ts

View workflow job for this annotation

GitHub Actions / E2E on ubuntu-latest (Node 20.8.0) - (4/4)

Child Process Error

stderr: [plugin:vite:reporter] [plugin vite:reporter] (!) /home/runner/work/_temp/waku-ssr-catch-error-SlNtfT/node_modules/waku/dist/middleware/context.js is dynamically imported by /home/runner/work/_temp/waku-ssr-catch-error-SlNtfT/node_modules/waku/dist/lib/config.js, /home/runner/work/_temp/waku-ssr-catch-error-SlNtfT/waku.config.ts but also statically imported by /home/runner/work/_temp/waku-ssr-catch-error-SlNtfT/node_modules/waku/dist/server.js, dynamic import will not move module into another chunk.

Check failure on line 1 in e2e/ssr-catch-error.spec.ts

View workflow job for this annotation

GitHub Actions / E2E on ubuntu-latest (Node 20.8.0) - (4/4)

Child Process Error

stderr: [plugin:vite:reporter] [plugin vite:reporter] (!) /home/runner/work/_temp/waku-ssr-catch-error-48AbPb/node_modules/waku/dist/middleware/context.js is dynamically imported by /home/runner/work/_temp/waku-ssr-catch-error-48AbPb/node_modules/waku/dist/lib/config.js, /home/runner/work/_temp/waku-ssr-catch-error-48AbPb/waku.config.ts but also statically imported by /home/runner/work/_temp/waku-ssr-catch-error-48AbPb/node_modules/waku/dist/server.js, dynamic import will not move module into another chunk.

Check failure on line 1 in e2e/ssr-catch-error.spec.ts

View workflow job for this annotation

GitHub Actions / E2E on macos-latest (Node 22.7.0) - (3/4)

Child Process Error

stderr: [plugin:vite:reporter] [plugin vite:reporter] (!) /Users/runner/work/_temp/waku-ssr-catch-error-W0Rvrt/node_modules/waku/dist/middleware/context.js is dynamically imported by /Users/runner/work/_temp/waku-ssr-catch-error-W0Rvrt/node_modules/waku/dist/lib/config.js, /Users/runner/work/_temp/waku-ssr-catch-error-W0Rvrt/waku.config.ts but also statically imported by /Users/runner/work/_temp/waku-ssr-catch-error-W0Rvrt/node_modules/waku/dist/server.js, dynamic import will not move module into another chunk.

Check failure on line 1 in e2e/ssr-catch-error.spec.ts

View workflow job for this annotation

GitHub Actions / E2E on ubuntu-latest (Node 20.8.0) - (4/4)

Child Process Error

stderr: [plugin:vite:reporter] [plugin vite:reporter] (!) /home/runner/work/_temp/waku-ssr-catch-error-NNpDhw/node_modules/waku/dist/middleware/context.js is dynamically imported by /home/runner/work/_temp/waku-ssr-catch-error-NNpDhw/node_modules/waku/dist/lib/config.js, /home/runner/work/_temp/waku-ssr-catch-error-NNpDhw/waku.config.ts but also statically imported by /home/runner/work/_temp/waku-ssr-catch-error-NNpDhw/node_modules/waku/dist/server.js, dynamic import will not move module into another chunk.

Check failure on line 1 in e2e/ssr-catch-error.spec.ts

View workflow job for this annotation

GitHub Actions / E2E on macos-latest (Node 22.7.0) - (3/4)

Child Process Error

stderr: [plugin:vite:reporter] [plugin vite:reporter] (!) /Users/runner/work/_temp/waku-ssr-catch-error-765Wxy/node_modules/waku/dist/middleware/context.js is dynamically imported by /Users/runner/work/_temp/waku-ssr-catch-error-765Wxy/node_modules/waku/dist/lib/config.js, /Users/runner/work/_temp/waku-ssr-catch-error-765Wxy/waku.config.ts but also statically imported by /Users/runner/work/_temp/waku-ssr-catch-error-765Wxy/node_modules/waku/dist/server.js, dynamic import will not move module into another chunk.

Check failure on line 1 in e2e/ssr-catch-error.spec.ts

View workflow job for this annotation

GitHub Actions / E2E on macos-latest (Node 22.7.0) - (3/4)

Child Process Error

stderr: [plugin:vite:reporter] [plugin vite:reporter] (!) /Users/runner/work/_temp/waku-ssr-catch-error-md8pEd/node_modules/waku/dist/middleware/context.js is dynamically imported by /Users/runner/work/_temp/waku-ssr-catch-error-md8pEd/node_modules/waku/dist/lib/config.js, /Users/runner/work/_temp/waku-ssr-catch-error-md8pEd/waku.config.ts but also statically imported by /Users/runner/work/_temp/waku-ssr-catch-error-md8pEd/node_modules/waku/dist/server.js, dynamic import will not move module into another chunk.

Check failure on line 1 in e2e/ssr-catch-error.spec.ts

View workflow job for this annotation

GitHub Actions / E2E on ubuntu-latest (Node 22.7.0) - (4/4)

Child Process Error

stderr: [plugin:vite:reporter] [plugin vite:reporter] (!) /home/runner/work/_temp/waku-ssr-catch-error-Oup6Vr/node_modules/waku/dist/middleware/context.js is dynamically imported by /home/runner/work/_temp/waku-ssr-catch-error-Oup6Vr/node_modules/waku/dist/lib/config.js, /home/runner/work/_temp/waku-ssr-catch-error-Oup6Vr/waku.config.ts but also statically imported by /home/runner/work/_temp/waku-ssr-catch-error-Oup6Vr/node_modules/waku/dist/server.js, dynamic import will not move module into another chunk.

Check failure on line 1 in e2e/ssr-catch-error.spec.ts

View workflow job for this annotation

GitHub Actions / E2E on ubuntu-latest (Node 22.7.0) - (4/4)

Child Process Error

stderr: [plugin:vite:reporter] [plugin vite:reporter] (!) /home/runner/work/_temp/waku-ssr-catch-error-vEOhRq/node_modules/waku/dist/middleware/context.js is dynamically imported by /home/runner/work/_temp/waku-ssr-catch-error-vEOhRq/node_modules/waku/dist/lib/config.js, /home/runner/work/_temp/waku-ssr-catch-error-vEOhRq/waku.config.ts but also statically imported by /home/runner/work/_temp/waku-ssr-catch-error-vEOhRq/node_modules/waku/dist/server.js, dynamic import will not move module into another chunk.

Check failure on line 1 in e2e/ssr-catch-error.spec.ts

View workflow job for this annotation

GitHub Actions / E2E on ubuntu-latest (Node 22.7.0) - (4/4)

Child Process Error

stderr: [plugin:vite:reporter] [plugin vite:reporter] (!) /home/runner/work/_temp/waku-ssr-catch-error-s1qtLr/node_modules/waku/dist/middleware/context.js is dynamically imported by /home/runner/work/_temp/waku-ssr-catch-error-s1qtLr/node_modules/waku/dist/lib/config.js, /home/runner/work/_temp/waku-ssr-catch-error-s1qtLr/waku.config.ts but also statically imported by /home/runner/work/_temp/waku-ssr-catch-error-s1qtLr/node_modules/waku/dist/server.js, dynamic import will not move module into another chunk.

Check failure on line 1 in e2e/ssr-catch-error.spec.ts

View workflow job for this annotation

GitHub Actions / E2E on macos-latest (Node 22.7.0) - (4/4)

Child Process Error

stderr: [plugin:vite:reporter] [plugin vite:reporter] (!) /Users/runner/work/_temp/waku-ssr-catch-error-MVtukO/node_modules/waku/dist/middleware/context.js is dynamically imported by /Users/runner/work/_temp/waku-ssr-catch-error-MVtukO/node_modules/waku/dist/lib/config.js, /Users/runner/work/_temp/waku-ssr-catch-error-MVtukO/waku.config.ts but also statically imported by /Users/runner/work/_temp/waku-ssr-catch-error-MVtukO/node_modules/waku/dist/server.js, dynamic import will not move module into another chunk.

Check failure on line 1 in e2e/ssr-catch-error.spec.ts

View workflow job for this annotation

GitHub Actions / E2E on macos-latest (Node 22.7.0) - (4/4)

Child Process Error

stderr: [plugin:vite:reporter] [plugin vite:reporter] (!) /Users/runner/work/_temp/waku-ssr-catch-error-OVhKqz/node_modules/waku/dist/middleware/context.js is dynamically imported by /Users/runner/work/_temp/waku-ssr-catch-error-OVhKqz/node_modules/waku/dist/lib/config.js, /Users/runner/work/_temp/waku-ssr-catch-error-OVhKqz/waku.config.ts but also statically imported by /Users/runner/work/_temp/waku-ssr-catch-error-OVhKqz/node_modules/waku/dist/server.js, dynamic import will not move module into another chunk.

Check failure on line 1 in e2e/ssr-catch-error.spec.ts

View workflow job for this annotation

GitHub Actions / E2E on macos-latest (Node 22.7.0) - (4/4)

Child Process Error

stderr: [plugin:vite:reporter] [plugin vite:reporter] (!) /Users/runner/work/_temp/waku-ssr-catch-error-IHeCfF/node_modules/waku/dist/middleware/context.js is dynamically imported by /Users/runner/work/_temp/waku-ssr-catch-error-IHeCfF/node_modules/waku/dist/lib/config.js, /Users/runner/work/_temp/waku-ssr-catch-error-IHeCfF/waku.config.ts but also statically imported by /Users/runner/work/_temp/waku-ssr-catch-error-IHeCfF/node_modules/waku/dist/server.js, dynamic import will not move module into another chunk.

Check failure on line 1 in e2e/ssr-catch-error.spec.ts

View workflow job for this annotation

GitHub Actions / E2E on ubuntu-latest (Node 20.8.0) - (2/4)

Child Process Error

stderr: [plugin:vite:reporter] [plugin vite:reporter] (!) /home/runner/work/_temp/waku-ssr-catch-error-cuKQxR/node_modules/waku/dist/middleware/context.js is dynamically imported by /home/runner/work/_temp/waku-ssr-catch-error-cuKQxR/node_modules/waku/dist/lib/config.js, /home/runner/work/_temp/waku-ssr-catch-error-cuKQxR/waku.config.ts but also statically imported by /home/runner/work/_temp/waku-ssr-catch-error-cuKQxR/node_modules/waku/dist/server.js, dynamic import will not move module into another chunk.

Check failure on line 1 in e2e/ssr-catch-error.spec.ts

View workflow job for this annotation

GitHub Actions / E2E on ubuntu-latest (Node 20.8.0) - (2/4)

Child Process Error

stderr: [plugin:vite:reporter] [plugin vite:reporter] (!) /home/runner/work/_temp/waku-ssr-catch-error-RhbaJn/node_modules/waku/dist/middleware/context.js is dynamically imported by /home/runner/work/_temp/waku-ssr-catch-error-RhbaJn/node_modules/waku/dist/lib/config.js, /home/runner/work/_temp/waku-ssr-catch-error-RhbaJn/waku.config.ts but also statically imported by /home/runner/work/_temp/waku-ssr-catch-error-RhbaJn/node_modules/waku/dist/server.js, dynamic import will not move module into another chunk.
import { execSync, exec } from 'node:child_process';
import { fileURLToPath } from 'node:url';
import { cp, mkdtemp } from 'node:fs/promises';
Expand Down Expand Up @@ -33,7 +33,7 @@
/ExperimentalWarning: Custom ESM Loaders is an experimental feature and might change at any time/,
]);
await waitPort({ port });
return [port, cp.pid];
return [port, cp.pid] as const;
}

for (const isDev of [true, false]) {
Expand Down
2 changes: 1 addition & 1 deletion e2e/use-router.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ async function start() {
]);

await waitPort({ port });
return [port, cp.pid];
return [port, cp.pid] as const;
}

test.describe('useRouter', async () => {
Expand Down
46 changes: 37 additions & 9 deletions packages/waku/src/minimal/client.ts
Original file line number Diff line number Diff line change
Expand Up @@ -224,8 +224,10 @@ const ChildrenContextProvider = memo(ChildrenContext.Provider);

type OuterSlotProps = {
elementsPromise: Elements;
shouldRenderPrev: ((err: unknown) => boolean) | undefined;
renderSlot: (elements: Record<string, ReactNode>) => ReactNode;
unstable_shouldRenderPrev:
| ((err: unknown, prevElements: Record<string, ReactNode>) => boolean)
| undefined;
renderSlot: (elements: Record<string, ReactNode>, err?: unknown) => ReactNode;
children?: ReactNode;
};

Expand All @@ -245,9 +247,12 @@ class OuterSlot extends Component<OuterSlotProps, { error?: unknown }> {
// probably caused by history api fallback
(e as any).statusCode = 404;
}
if (this.props.shouldRenderPrev?.(e) && this.props.elementsPromise.prev) {
const elements = this.props.elementsPromise.prev;
return this.props.renderSlot(elements);
const prevElements = this.props.elementsPromise.prev;
if (
prevElements &&
this.props.unstable_shouldRenderPrev?.(e, prevElements)
) {
return this.props.renderSlot(prevElements, e);
} else {
throw e;
}
Expand All @@ -261,12 +266,16 @@ const InnerSlot = ({
renderSlot,
}: {
elementsPromise: Elements;
renderSlot: (elements: Record<string, ReactNode>) => ReactNode;
renderSlot: (elements: Record<string, ReactNode>, err?: unknown) => ReactNode;
}) => {
const elements = use(elementsPromise);
return renderSlot(elements);
};

const InnerErr = ({ err }: { err: unknown }) => {
throw err;
};

/**
* Slot component
* This is used under the Root component.
Expand All @@ -286,19 +295,32 @@ export const Slot = ({
children,
fallback,
unstable_shouldRenderPrev,
unstable_renderPrev,
}: {
id: string;
children?: ReactNode;
fallback?: ReactNode;
unstable_shouldRenderPrev?: (err: unknown) => boolean;
unstable_shouldRenderPrev?: (
err: unknown,
prevElements: Record<string, ReactNode>,
) => boolean;
unstable_renderPrev?: boolean;
}) => {
const elementsPromise = use(ElementsContext);
if (!elementsPromise) {
throw new Error('Missing Root component');
}
const renderSlot = (elements: Record<string, ReactNode>) => {
const renderSlot = (elements: Record<string, ReactNode>, err?: unknown) => {
if (!(id in elements)) {
if (fallback) {
if (err) {
// HACK I'm not sure if this is the right way
return createElement(
ChildrenContextProvider,
{ value: createElement(InnerErr, { err }) },
fallback,
);
Comment on lines +317 to +322
Copy link
Owner Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I wonder if this hack works for new_createPages fallback. Let check it after merging...

Copy link
Owner Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It doesn't work. so #1015.

}
return fallback;
}
throw new Error('Not found: ' + id);
Expand All @@ -309,11 +331,17 @@ export const Slot = ({
elements[id],
);
};
if (unstable_renderPrev) {
if (!elementsPromise.prev) {
throw new Error('Missing prev elements');
}
return renderSlot(elementsPromise.prev);
}
Comment on lines +334 to +339
Copy link
Owner Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm not happy with this, and hope to redesign it after finishing our current transition.

return createElement(
OuterSlot,
{
elementsPromise,
shouldRenderPrev: unstable_shouldRenderPrev,
unstable_shouldRenderPrev,
renderSlot,
},
createElement(InnerSlot, { elementsPromise, renderSlot }),
Expand Down
13 changes: 11 additions & 2 deletions packages/waku/src/router/client.ts
Original file line number Diff line number Diff line change
Expand Up @@ -322,7 +322,7 @@ const RouterSlot = ({
fallback?: ReactNode;
children?: ReactNode;
}) => {
const unstable_shouldRenderPrev = (_err: unknown) => {
const unstable_shouldRenderPrev = () => {
const shouldSkip = routerData[0];
const skip = getSkipList(shouldSkip, [id], route, cachedRef.current);
return skip.length > 0;
Expand Down Expand Up @@ -758,7 +758,16 @@ const NewInnerRouter = ({
});
});

const routeElement = createElement(Slot, { id: getRouteSlotId(route.path) });
const routeElement = createElement(Slot, {
id: getRouteSlotId(route.path),
unstable_shouldRenderPrev: (_err, prevElements) =>
// HACK this might not work in some cases
'fallback' in prevElements,
fallback: createElement(Slot, {
id: 'fallback',
unstable_renderPrev: true,
}),
});

return createElement(
RouterContext.Provider,
Expand Down
9 changes: 9 additions & 0 deletions packages/waku/src/router/create-pages.ts
Original file line number Diff line number Diff line change
Expand Up @@ -826,6 +826,15 @@ export const new_createPages = <
{ id: 'root' },
createNestedElements(routeChildren),
),
// HACK this is hard-coded convention
// FIXME we should revisit the error boundary use case design
fallbackElement: createElement(
Slot,
{ id: 'root', unstable_renderPrev: true },
layoutPaths.includes('/')
? createElement(Slot, { id: 'layout:/', unstable_renderPrev: true })
: null,
),
};
},
});
Expand Down
9 changes: 6 additions & 3 deletions packages/waku/src/router/define-router.ts
Original file line number Diff line number Diff line change
Expand Up @@ -302,13 +302,13 @@ export function new_defineRouter(fns: {
) => Promise<{
routeElement: ReactNode;
elements: Record<SlotId, ReactNode>;
fallbackElement?: ReactNode;
}>;
}): ReturnType<typeof defineEntries> {
const platformObject = unstable_getPlatformObject();
type MyPathConfig = {
pattern: string;
pathname: PathSpec;
isStaticRouteElement: boolean;
staticElementIds: SlotId[];
isStatic?: boolean | undefined;
specs: { noSsr?: boolean; is404: boolean };
Expand All @@ -328,7 +328,6 @@ export function new_defineRouter(fns: {
return {
pattern: item.pattern,
pathname: item.path,
isStaticRouteElement: !!item.routeElement.isStatic,
staticElementIds: Object.entries(item.elements).flatMap(
([id, { isStatic }]) => (isStatic ? [id] : []),
),
Expand Down Expand Up @@ -393,7 +392,7 @@ export function new_defineRouter(fns: {
return null;
}
const { query, skip } = parseRscParams(rscParams);
const { routeElement, elements } = await fns.renderRoute(
const { routeElement, elements, fallbackElement } = await fns.renderRoute(
pathname,
pathStatus.isStatic ? {} : { query },
);
Expand All @@ -405,6 +404,10 @@ export function new_defineRouter(fns: {
const entries = {
...elements,
[ROUTE_SLOT_ID_PREFIX + pathname]: routeElement,
...((fallbackElement ? { fallback: fallbackElement } : {}) as Record<
string,
ReactNode
>),
};
for (const skipId of await filterEffectiveSkip(pathname, skip)) {
delete entries[skipId];
Expand Down
Loading