so if it interacts with the filesystem, it wont work
so if it interacts with the filesystem, it wont work
fs does not work within cloudflare pages?Error logs can be super cryptic, like "Error: The script will never generate a response."This would be a bug that generally you should open an issue on our repo for. Another user raised an issue a couple days ago about this that we have fixed related to the fetch patch which may also solve the problem for you - I'll shoot dario a message about making a release.
Github issues can stay unanswered for 2 weeksPlease feel free to bump an issue or add additional context if it's also affecting you.
fs09:47:38.194 ⚡️ Build log saved to '.vercel/output/static/_worker.js/nop-build-log.json'
09:47:38.194 ⚡️ Generated '.vercel/output/static/_worker.js/index.js'.
09:47:38.194 ⚡️ Build completed in 2.80s
09:47:38.257 Finished
09:47:38.257 Note: No functions dir at /functions found. Skipping.
09:47:38.257 Validating asset output directory
09:47:38.258 Error: Output directory " .vercel/output/static" not found.
09:47:39.593 Failed: build output directory not foundname: Deploy
on:
push:
branches:
- 'releases/**'
jobs:
deploy:
runs-on: ubuntu-latest
permissions:
contents: read
deployments: write
steps:
- name: Checkout code
uses: actions/checkout@v3
- uses: pnpm/action-setup@v2
with:
version: 8
- uses: actions/setup-node@v3
with:
node-version: 20
cache: 'pnpm'
- name: Install dependencies
run: pnpm install --frozen-lockfile
#
# Build web app
#
- name: Build web
run: pnpm run pages:build
#
# Deploy to Cloudflare Pages
#
- name: Publish
uses: cloudflare/pages-action@1
with:
apiToken: ${{ secrets.CLOUDFLARE_API_TOKEN }}
accountId: ${{ secrets.CLOUDFLARE_ACCOUNT_ID }}
projectName: project-name
directory: .vercel/output/static
gitHubToken: ${{ secrets.GITHUB_TOKEN }}interface CloudflareEnv {
DB: D1Database;
}import { D1Database } from "@cloudflare/workers-types";
import { drizzle } from "drizzle-orm/d1";
import { getRequestContext } from "@cloudflare/next-on-pages";
export const db = drizzle(
process.env.NODE_ENV === "development"
? getRequestContext().env.DB
: (process.env as unknown as CloudflareEnv).DB,
);import NextAuth, { type DefaultSession } from "next-auth";
import AzureAD from "next-auth/providers/azure-ad";
import { NextResponse } from "next/server";
import { DrizzleAdapter } from "@auth/drizzle-adapter";
import { db } from "@/db/db-connection";
export const {
handlers: { GET, POST },
auth,
signIn,
} = NextAuth({
secret: process.env.NEXTAUTH_SECRET as string,
trustHost: true,
session: {
strategy: "database",
},
adapter: DrizzleAdapter(db),
providers: [
//...provider stuff
],
callbacks: {
//...callback stuff
},
});