diff --git a/apps/api/src/lib/auth.ts b/apps/api/src/lib/auth.ts index 8e89836..6a088d9 100644 --- a/apps/api/src/lib/auth.ts +++ b/apps/api/src/lib/auth.ts @@ -77,11 +77,12 @@ async function verifyAccessJwt( return valid ? payload : null; } -function b64urlDecode(s: string): Uint8Array { +function b64urlDecode(s: string): Uint8Array { const pad = s.length % 4 === 0 ? '' : '='.repeat(4 - (s.length % 4)); const b64 = (s + pad).replace(/-/g, '+').replace(/_/g, '/'); const bin = atob(b64); - const out = new Uint8Array(bin.length); + const buf = new ArrayBuffer(bin.length); + const out = new Uint8Array(buf); for (let i = 0; i < bin.length; i++) out[i] = bin.charCodeAt(i); return out; } diff --git a/apps/web/functions/api/[[path]].ts b/apps/web/functions/api/[[path]].ts index b0fb97d..4d16550 100644 --- a/apps/web/functions/api/[[path]].ts +++ b/apps/web/functions/api/[[path]].ts @@ -4,4 +4,4 @@ import type { AppEnv } from '@leetete/api/env'; const app = createApp(); export const onRequest: PagesFunction = (ctx) => - app.fetch(ctx.request, ctx.env, ctx); + app.fetch(ctx.request, ctx.env, ctx as unknown as ExecutionContext); diff --git a/apps/web/package.json b/apps/web/package.json index 3085b9b..7925329 100644 --- a/apps/web/package.json +++ b/apps/web/package.json @@ -5,7 +5,7 @@ "type": "module", "scripts": { "dev": "vite", - "build": "tsc -b && vite build", + "build": "tsc --noEmit && vite build", "preview": "vite preview", "typecheck": "tsc --noEmit", "deploy": "wrangler pages deploy dist --project-name stefanieeleandro", diff --git a/apps/web/tsconfig.json b/apps/web/tsconfig.json index 5a635c3..fde5a0b 100644 --- a/apps/web/tsconfig.json +++ b/apps/web/tsconfig.json @@ -6,6 +6,5 @@ "noEmit": true, "types": ["vite/client", "@cloudflare/workers-types"] }, - "include": ["src/**/*", "functions/**/*"], - "references": [{ "path": "./tsconfig.node.json" }] + "include": ["src/**/*", "functions/**/*", "vite.config.ts"] } diff --git a/apps/web/tsconfig.node.json b/apps/web/tsconfig.node.json deleted file mode 100644 index 5cb358c..0000000 --- a/apps/web/tsconfig.node.json +++ /dev/null @@ -1,11 +0,0 @@ -{ - "extends": "../../tsconfig.base.json", - "compilerOptions": { - "composite": true, - "noEmit": true, - "module": "ESNext", - "moduleResolution": "Bundler", - "types": ["node"] - }, - "include": ["vite.config.ts"] -}