mirror of
https://github.com/stackblitz-labs/bolt.diy
synced 2025-05-06 13:14:35 +00:00
* V1 ## [Unreleased] - 2025-03-28 ### ✅ Fixed - Fixed deployment errors on Cloudflare Pages caused by: - Missing or outdated `compatibility_date` and `compatibility_flags` in `wrangler.toml` - Use of Node.js built-ins (`crypto`, `stream`) in functions without proper polyfilling - Invalid Wrangler CLI options (`--log-level`) used during deployment - Type error when importing the Remix server build ### 🛠 Changed - `wrangler.toml` updated: ```toml name = "bolt" compatibility_date = "2025-03-28" compatibility_flags = ["nodejs_compat"] pages_build_output_dir = "./build/client" send_metrics = false ``` - `functions/[[path]].ts` updated: ```ts import type { ServerBuild } from '@remix-run/cloudflare'; import { createPagesFunctionHandler } from '@remix-run/cloudflare-pages'; import * as serverBuild from '../build/server'; export const onRequest = createPagesFunctionHandler({ build: serverBuild as unknown as ServerBuild, }); ``` ### 🚀 Deployment - Successful deployment to: - Preview: https://979e2ca9.bolt-55b.pages.dev - Production: https://main.bolt-55b.pages.dev * V1 ## [Unreleased] - 2025-03-28 ### ✅ Fixed - Fixed deployment errors on Cloudflare Pages caused by: - Missing or outdated `compatibility_date` and `compatibility_flags` in `wrangler.toml` - Use of Node.js built-ins (`crypto`, `stream`) in functions without proper polyfilling - Invalid Wrangler CLI options (`--log-level`) used during deployment - Type error when importing the Remix server build ### 🛠 Changed - `wrangler.toml` updated: ```toml name = "bolt" compatibility_date = "2025-03-28" compatibility_flags = ["nodejs_compat"] pages_build_output_dir = "./build/client" send_metrics = false ``` - `functions/[[path]].ts` updated: ```ts import type { ServerBuild } from '@remix-run/cloudflare'; import { createPagesFunctionHandler } from '@remix-run/cloudflare-pages'; import * as serverBuild from '../build/server'; export const onRequest = createPagesFunctionHandler({ build: serverBuild as unknown as ServerBuild, }); ``` ### 🚀 Deployment - Successful deployment to: - Preview: https://979e2ca9.bolt-55b.pages.dev - Production: https://main.bolt-55b.pages.dev * feat: small bugfix
13 lines
386 B
TypeScript
13 lines
386 B
TypeScript
import type { ServerBuild } from '@remix-run/cloudflare';
|
|
import { createPagesFunctionHandler } from '@remix-run/cloudflare-pages';
|
|
|
|
export const onRequest: PagesFunction = async (context) => {
|
|
const serverBuild = (await import('../build/server')) as unknown as ServerBuild;
|
|
|
|
const handler = createPagesFunctionHandler({
|
|
build: serverBuild,
|
|
});
|
|
|
|
return handler(context);
|
|
};
|