mirror of
https://github.com/stackblitz-labs/bolt.diy
synced 2025-06-26 18:26:38 +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
This commit is contained in:
parent
1364d4a503
commit
47444970e8
8
.gitignore
vendored
8
.gitignore
vendored
@ -44,3 +44,11 @@ changelogUI.md
|
||||
docs/instructions/Roadmap.md
|
||||
.cursorrules
|
||||
*.md
|
||||
<<<<<<< Updated upstream
|
||||
=======
|
||||
.qodo
|
||||
exponent.txt
|
||||
<<<<<<< Updated upstream
|
||||
>>>>>>> Stashed changes
|
||||
=======
|
||||
>>>>>>> Stashed changes
|
||||
|
@ -1,9 +1,12 @@
|
||||
import type { ServerBuild } from '@remix-run/cloudflare';
|
||||
import { createPagesFunctionHandler } from '@remix-run/cloudflare-pages';
|
||||
|
||||
// @ts-ignore because the server build file is generated by `remix vite:build`
|
||||
import * as serverBuild from '../build/server';
|
||||
export const onRequest: PagesFunction = async (context) => {
|
||||
const serverBuild = (await import('../build/server')) as unknown as ServerBuild;
|
||||
|
||||
export const onRequest = createPagesFunctionHandler({
|
||||
build: serverBuild as unknown as ServerBuild,
|
||||
});
|
||||
const handler = createPagesFunctionHandler({
|
||||
build: serverBuild,
|
||||
});
|
||||
|
||||
return handler(context);
|
||||
};
|
||||
|
@ -170,11 +170,12 @@
|
||||
"@types/path-browserify": "^1.0.3",
|
||||
"@types/react": "^18.3.12",
|
||||
"@types/react-dom": "^18.3.1",
|
||||
"@vitejs/plugin-react": "^4.3.4",
|
||||
"concurrently": "^8.2.2",
|
||||
"cross-env": "^7.0.3",
|
||||
"crypto-browserify": "^3.12.1",
|
||||
"electron": "^33.2.0",
|
||||
"electron-builder": "^25.1.8",
|
||||
"@vitejs/plugin-react": "^4.3.4",
|
||||
"fast-glob": "^3.3.2",
|
||||
"husky": "9.1.7",
|
||||
"is-ci": "^3.0.1",
|
||||
@ -184,6 +185,7 @@
|
||||
"prettier": "^3.4.1",
|
||||
"rimraf": "^4.4.1",
|
||||
"sass-embedded": "^1.81.0",
|
||||
"stream-browserify": "^3.0.0",
|
||||
"typescript": "^5.7.2",
|
||||
"unified": "^11.0.5",
|
||||
"unocss": "^0.61.9",
|
||||
@ -192,7 +194,7 @@
|
||||
"vite-plugin-optimize-css-modules": "^1.1.0",
|
||||
"vite-tsconfig-paths": "^4.3.2",
|
||||
"vitest": "^2.1.7",
|
||||
"wrangler": "^3.91.0"
|
||||
"wrangler": "^4.5.1"
|
||||
},
|
||||
"resolutions": {
|
||||
"@typescript-eslint/utils": "^8.0.0-alpha.30"
|
||||
|
822
pnpm-lock.yaml
822
pnpm-lock.yaml
File diff suppressed because it is too large
Load Diff
@ -11,7 +11,6 @@ import { join } from 'path';
|
||||
|
||||
dotenv.config();
|
||||
|
||||
// Get detailed git info with fallbacks
|
||||
const getGitInfo = () => {
|
||||
try {
|
||||
return {
|
||||
@ -40,7 +39,6 @@ const getGitInfo = () => {
|
||||
}
|
||||
};
|
||||
|
||||
// Read package.json with detailed dependency info
|
||||
const getPackageJson = () => {
|
||||
try {
|
||||
const pkgPath = join(process.cwd(), 'package.json');
|
||||
@ -89,7 +87,6 @@ export default defineConfig((config) => {
|
||||
__PKG_DEV_DEPENDENCIES: JSON.stringify(pkg.devDependencies),
|
||||
__PKG_PEER_DEPENDENCIES: JSON.stringify(pkg.peerDependencies),
|
||||
__PKG_OPTIONAL_DEPENDENCIES: JSON.stringify(pkg.optionalDependencies),
|
||||
// Define global values
|
||||
'process.env.NODE_ENV': JSON.stringify(process.env.NODE_ENV),
|
||||
},
|
||||
build: {
|
||||
@ -113,18 +110,19 @@ export default defineConfig((config) => {
|
||||
resolve: {
|
||||
alias: {
|
||||
buffer: 'vite-plugin-node-polyfills/polyfills/buffer',
|
||||
crypto: 'crypto-browserify',
|
||||
stream: 'stream-browserify',
|
||||
},
|
||||
},
|
||||
plugins: [
|
||||
nodePolyfills({
|
||||
include: ['buffer', 'process', 'util', 'stream'],
|
||||
include: ['buffer', 'process', 'util', 'stream', 'crypto'],
|
||||
globals: {
|
||||
Buffer: true,
|
||||
process: true,
|
||||
global: true,
|
||||
},
|
||||
protocolImports: true,
|
||||
// Exclude Node.js modules that shouldn't be polyfilled in Cloudflare
|
||||
exclude: ['child_process', 'fs', 'path'],
|
||||
}),
|
||||
{
|
||||
@ -136,6 +134,8 @@ export default defineConfig((config) => {
|
||||
map: null,
|
||||
};
|
||||
}
|
||||
|
||||
return null;
|
||||
},
|
||||
},
|
||||
config.mode !== 'test' && remixCloudflareDevProxy(),
|
||||
|
@ -1,6 +1,6 @@
|
||||
#:schema node_modules/wrangler/config-schema.json
|
||||
name = "bolt"
|
||||
compatibility_flags = ["nodejs_compat"]
|
||||
compatibility_date = "2024-07-01"
|
||||
compatibility_date = "2025-03-28"
|
||||
pages_build_output_dir = "./build/client"
|
||||
send_metrics = false
|
||||
send_metrics = false
|
||||
|
Loading…
Reference in New Issue
Block a user