Error: Cannot find module '.../node_modules/.pnpm/@[email protected][email protected]/node_modules/@solidjs/router/dist/integration' imported from /node_modules/.pnpm/@[email protected][email protected]/node_modules/@solidjs/router/dist/routing.js
export default mergeConfig(viteConfig, defineConfig({ test: { setupFiles: [ "./tests/init.ts", ], environment: "jsdom", globals: true, threads: false, isolate: false, includeSource: ["src/**/*.{js,ts,tsx,jsx}"], transformMode: { web: [/\.[jt]sx?$/], }, open: false, }, resolve: { conditions: ["development", "browser"], },}));
async function preProcessor(forward: MiddlewareFn, event: FetchEvent, session: Session) { const response = await forward(event); console.log("status", response.status); if (response.status === 401) { return redirect("/", { headers: { "Set-Cookie": await storage.destroySession(session), }, }); } return response;}
({ forward }) => { return async (event) => { const pathname = new URL(event.request.url).pathname; const isApiPath = pathname.startsWith("/api") || pathname.startsWith("/_m"); const session = await getSession(event.request.headers.get("Cookie")); if (isApiPath) { return await preProcessor (forward, event, session); }})