Jacob
Jacob
Explore posts from servers
CDCloudflare Developers
Created by Jacob on 9/17/2024 in #pages-help
Getting 500 internal server error - Nextjs
For some reason my application is getting 500 errors when deployed, works fine when building and running locally but fails in production. When i check the logs i get this:
{
"truncated": false,
"outcome": "ok",
"scriptName": "pages-worker--2194227-production",
"diagnosticsChannelEvents": [],
"exceptions": [],
"logs": [
{
"message": [
"Error: An error occurred while evaluating the target edge function (__next-on-pages-dist__/functions/src/middleware.func.js)"
],
"level": "error",
"timestamp": 1726567894480
}
],
// ... rest is attached in json file
}
{
"truncated": false,
"outcome": "ok",
"scriptName": "pages-worker--2194227-production",
"diagnosticsChannelEvents": [],
"exceptions": [],
"logs": [
{
"message": [
"Error: An error occurred while evaluating the target edge function (__next-on-pages-dist__/functions/src/middleware.func.js)"
],
"level": "error",
"timestamp": 1726567894480
}
],
// ... rest is attached in json file
}
The build logs seem to be totally fine so not sure what is up Links: https://github.com/jacobsamo/buzztrip https://buzztrip.co https://buzztrip.pages.dev https://0c1dc957.buzztrip.pages.dev
1 replies
CDCloudflare Developers
Created by Jacob on 9/9/2024 in #pages-help
Configuring a monorepo
So i am looking to configure a monorepo for Cloudflare Pages, i have a Nextjs app under /apps/web which will need @cloudflare/next-on-pages to build. However i can't figure out how to get it all working. My repo: https://github.com/jacobsamo/BuzzTrip
2 replies
CDCloudflare Developers
Created by Jacob on 8/4/2024 in #pages-help
Bun failing builds
I want to use bun to run my cloudflare builds however it fails every time and not sure why, this is my stack trace:
12:05:01.271 Cloning repository...
12:05:01.953 From https://github.com/jacobsamo/website
12:05:01.954 * branch e783baa52cc0afe5427458b8a143b9beb00a07f4 -> FETCH_HEAD
12:05:01.954
12:05:01.991 HEAD is now at e783baa set package manager in package.json
12:05:01.992
12:05:02.085
12:05:02.085 Using v2 root directory strategy
12:05:02.115 Success: Finished cloning repository files
12:05:07.642 Checking for configuration in a wrangler.toml configuration file (BETA)
12:05:07.643
12:05:07.643 Found wrangler.toml file. Reading build configuration...
12:05:07.649 pages_build_output_dir: dist
12:05:07.649 Build environment variables: (none found)
12:05:07.764 Successfully read wrangler.toml file.
12:05:07.922 Detected the following tools from environment: [email protected], [email protected]
12:05:07.923 Installing bun 1.1.22
12:05:08.071 Downloading Bun v1.1.22...
12:05:08.279 curl: (22) The requested URL returned error: 404
12:05:08.283 Fail: Couldn't download the Bun binary from https://github.com/oven-sh/bun/releases/download/bun-v1.1.22/bun-linux-x64.zip
12:05:08.289 Fail: Failed to download Bun v1.1.22
12:05:08.300 Error: Exit with error code: 1
12:05:08.301 at ChildProcess.<anonymous> (/snapshot/dist/run-build.js)
12:05:08.301 at Object.onceWrapper (node:events:652:26)
12:05:08.301 at ChildProcess.emit (node:events:537:28)
12:05:08.301 at ChildProcess._handle.onexit (node:internal/child_process:291:12)
12:05:08.311 Failed: build command exited with code: 1
12:05:09.461 Failed: error occurred while running build command
12:05:01.271 Cloning repository...
12:05:01.953 From https://github.com/jacobsamo/website
12:05:01.954 * branch e783baa52cc0afe5427458b8a143b9beb00a07f4 -> FETCH_HEAD
12:05:01.954
12:05:01.991 HEAD is now at e783baa set package manager in package.json
12:05:01.992
12:05:02.085
12:05:02.085 Using v2 root directory strategy
12:05:02.115 Success: Finished cloning repository files
12:05:07.642 Checking for configuration in a wrangler.toml configuration file (BETA)
12:05:07.643
12:05:07.643 Found wrangler.toml file. Reading build configuration...
12:05:07.649 pages_build_output_dir: dist
12:05:07.649 Build environment variables: (none found)
12:05:07.764 Successfully read wrangler.toml file.
12:05:07.922 Detected the following tools from environment: [email protected], [email protected]
12:05:07.923 Installing bun 1.1.22
12:05:08.071 Downloading Bun v1.1.22...
12:05:08.279 curl: (22) The requested URL returned error: 404
12:05:08.283 Fail: Couldn't download the Bun binary from https://github.com/oven-sh/bun/releases/download/bun-v1.1.22/bun-linux-x64.zip
12:05:08.289 Fail: Failed to download Bun v1.1.22
12:05:08.300 Error: Exit with error code: 1
12:05:08.301 at ChildProcess.<anonymous> (/snapshot/dist/run-build.js)
12:05:08.301 at Object.onceWrapper (node:events:652:26)
12:05:08.301 at ChildProcess.emit (node:events:537:28)
12:05:08.301 at ChildProcess._handle.onexit (node:internal/child_process:291:12)
12:05:08.311 Failed: build command exited with code: 1
12:05:09.461 Failed: error occurred while running build command
I have removed the bun.lockb and added to .gitignore beacuse that too was failing now it is set through package.json with this line: "packageManager": "[email protected]" not sure how to fix this
7 replies
CDCloudflare Developers
Created by Jacob on 2/24/2024 in #pages-help
build exceeding memory limit
so i have a pretty large nextjs application and it builds fine without having export const runtime = "edge"; set however once i set this in my layout.tsx it maxs out for some reason
<--- Last few GCs --->

[15444:0000020BA9850080] 56838 ms: Mark-Compact (reduce) 3066.7 (3085.9) -> 3065.8 (3085.9) MB, 212.79 / 0.00 ms (average m05) allocation failure; scavenge might not succeed
[15444:0000020BA9850080] 57296 ms: Mark-Compact (reduce) 3066.8 (3085.9) -> 3066.1 (3086.1) MB, 457.69 / 0.00 ms (average m02) allocation failure; scavenge might not succeed

<--- JS stacktrace --->

FATAL ERROR: Reached heap limit Allocation failed - JavaScript heap out of memory
----- Native stack trace -----

1: 00007FF6558EC44B node::SetCppgcReference+15579
2: 00007FF6558634B4 DSA_meth_get_flags+87796
3: 00007FF6563263F1 v8::Isolate::ReportExternalAllocationLimitReached+65
4: 00007FF65630FDA8 v8::Function::Experimental_IsNopFunction+1192
5: 00007FF656160C00 v8::PrimitiveArray::Length+426608
6: 00007FF65615DEE5 v8::PrimitiveArray::Length+415061
7: 00007FF6561732E4 v8::PrimitiveArray::Length+502100
8: 00007FF656173BA8 v8::PrimitiveArray::Length+504344
9: 00007FF656183CC9 v8::PrimitiveArray::Length+570169
10: 00007FF655E5172B v8::CodeEvent::GetFunctionName+112299
11: 00007FF5F63A667A
Compiler edge-server unexpectedly exited with code: 134 and signal: null

> Build error occurred
2.0\node_modules\next\dist\compiled\jest-worker\index.js:1:12545)
at ChildProcess.emit (node:events:531:35)
at ChildProcess._handle.onexit (node:internal/child_process:294:12) {
type: 'WorkerError'
}
 ELIFECYCLE  Command failed with exit code 1.
ERROR: command finished with error: command (G:\GitHub\mixie-normal-image\apps\mixie) C:\Users\jacob\AppData\Local\pnpm\pnpm.CMD run build exited (1)
: command (G:\GitHub\mixie-normal-image\apps\mixie) C:\Users\jacob\AppData\Local\pnpm\pnpm.CMD run build exited (1)
<--- Last few GCs --->

[15444:0000020BA9850080] 56838 ms: Mark-Compact (reduce) 3066.7 (3085.9) -> 3065.8 (3085.9) MB, 212.79 / 0.00 ms (average m05) allocation failure; scavenge might not succeed
[15444:0000020BA9850080] 57296 ms: Mark-Compact (reduce) 3066.8 (3085.9) -> 3066.1 (3086.1) MB, 457.69 / 0.00 ms (average m02) allocation failure; scavenge might not succeed

<--- JS stacktrace --->

FATAL ERROR: Reached heap limit Allocation failed - JavaScript heap out of memory
----- Native stack trace -----

1: 00007FF6558EC44B node::SetCppgcReference+15579
2: 00007FF6558634B4 DSA_meth_get_flags+87796
3: 00007FF6563263F1 v8::Isolate::ReportExternalAllocationLimitReached+65
4: 00007FF65630FDA8 v8::Function::Experimental_IsNopFunction+1192
5: 00007FF656160C00 v8::PrimitiveArray::Length+426608
6: 00007FF65615DEE5 v8::PrimitiveArray::Length+415061
7: 00007FF6561732E4 v8::PrimitiveArray::Length+502100
8: 00007FF656173BA8 v8::PrimitiveArray::Length+504344
9: 00007FF656183CC9 v8::PrimitiveArray::Length+570169
10: 00007FF655E5172B v8::CodeEvent::GetFunctionName+112299
11: 00007FF5F63A667A
Compiler edge-server unexpectedly exited with code: 134 and signal: null

> Build error occurred
2.0\node_modules\next\dist\compiled\jest-worker\index.js:1:12545)
at ChildProcess.emit (node:events:531:35)
at ChildProcess._handle.onexit (node:internal/child_process:294:12) {
type: 'WorkerError'
}
 ELIFECYCLE  Command failed with exit code 1.
ERROR: command finished with error: command (G:\GitHub\mixie-normal-image\apps\mixie) C:\Users\jacob\AppData\Local\pnpm\pnpm.CMD run build exited (1)
: command (G:\GitHub\mixie-normal-image\apps\mixie) C:\Users\jacob\AppData\Local\pnpm\pnpm.CMD run build exited (1)
3 replies