Skip to content

Commit 6bae2e0

Browse files
committed
fix(insights app): dev mode crash
1 parent d66866e commit 6bae2e0

File tree

3 files changed

+28
-4
lines changed

3 files changed

+28
-4
lines changed

packages/insights/src/routes/index.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ export default component$(() => {
1111
return (
1212
<Layout>
1313
<Container position="center" width="small">
14-
<div class="felx-nowrap flex min-h-[calc(100vh-76px)] flex-col items-center justify-center">
14+
<div class="flex-nowrap flex min-h-[calc(100vh-76px)] flex-col items-center justify-center">
1515
<div class="rounded-lg bg-white p-10 text-center shadow-sm">
1616
<h1 class="h1 mb-20">Welcome</h1>
1717
<Button

packages/insights/src/routes/layout.tsx

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,18 @@ import type { GetSessionResult } from '@auth/qwik';
66

77
export type SessionData = Awaited<GetSessionResult>['data'];
88

9+
// Uncomment the following to mock an authenticated user
10+
// export const onRequest = async ({ sharedMap, env }: { sharedMap: Map<string, any>; env: any }) => {
11+
// sharedMap.set('session', {
12+
// expires: new Date(0).toString(),
13+
// user: {
14+
// id: 'user',
15+
// name: 'user',
16+
// email: 'user@localhost',
17+
// },
18+
// } as SessionData);
19+
// };
20+
921
export const useUserSession = routeLoader$(({ sharedMap, redirect, url }) => {
1022
const session = sharedMap.get('session') as SessionData;
1123
if (session && url.pathname === '/') {

packages/insights/vite.config.ts

Lines changed: 15 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,21 @@ import tsconfigPaths from 'vite-tsconfig-paths';
77
import tailwindcss from '@tailwindcss/vite';
88

99
export default defineConfig({
10+
environments: {
11+
client: {
12+
optimizeDeps: {
13+
exclude: ['@auth/qwik', '@modular-forms/qwik'],
14+
},
15+
},
16+
ssr: {
17+
build: {
18+
sourcemap: true,
19+
},
20+
resolve: {
21+
noExternal: ['@auth/qwik', '@modular-forms/qwik'],
22+
},
23+
},
24+
},
1025
plugins: [
1126
macroPlugin({ preset: 'pandacss' }),
1227
qwikRouter(),
@@ -22,7 +37,4 @@ export default defineConfig({
2237
'Cache-Control': 'public, max-age=600',
2338
},
2439
},
25-
optimizeDeps: {
26-
include: ['@auth/core'],
27-
},
2840
});

0 commit comments

Comments
 (0)