shixzie
shixzie
Explore posts from servers
CDCloudflare Developers
Created by shixzie on 6/2/2023 in #pages-help
Next build succeeds but it fails to "find a module"?
I got a Next 13 app with Server components, everything was working fine and then I started getting errors on my builds (look at the last line)
...
09:57:35.704 - __next-on-pages-dist__/functions/api/[...path].func.js (esm)
09:57:35.864 ✨ Compiled Worker successfully
09:57:35.936 Found _routes.json in output directory. Uploading.
09:57:35.953 Validating asset output directory
09:57:36.741 Deploying your site to Cloudflare's global network...
09:57:38.765 Parsed 1 valid header rule.
09:57:40.268 Uploading... (31/45)
09:57:40.866 Uploading... (35/45)
09:57:41.007 Uploading... (40/45)
09:57:41.198 Uploading... (45/45)
09:57:41.199 ✨ Success! Uploaded 14 files (31 already uploaded) (1.52 sec)
09:57:41.199
09:57:41.929 ✨ Upload complete!
09:57:43.783 Success: Assets published!
09:57:45.014 Error: Failed to publish your Function. Got error: Uncaught Error: No such module "opt/buildhome/repo/.vercel/output/static/_worker.js/index.js".
imported from "bundledWorker-0.37093777238877634.mjs"
...
09:57:35.704 - __next-on-pages-dist__/functions/api/[...path].func.js (esm)
09:57:35.864 ✨ Compiled Worker successfully
09:57:35.936 Found _routes.json in output directory. Uploading.
09:57:35.953 Validating asset output directory
09:57:36.741 Deploying your site to Cloudflare's global network...
09:57:38.765 Parsed 1 valid header rule.
09:57:40.268 Uploading... (31/45)
09:57:40.866 Uploading... (35/45)
09:57:41.007 Uploading... (40/45)
09:57:41.198 Uploading... (45/45)
09:57:41.199 ✨ Success! Uploaded 14 files (31 already uploaded) (1.52 sec)
09:57:41.199
09:57:41.929 ✨ Upload complete!
09:57:43.783 Success: Assets published!
09:57:45.014 Error: Failed to publish your Function. Got error: Uncaught Error: No such module "opt/buildhome/repo/.vercel/output/static/_worker.js/index.js".
imported from "bundledWorker-0.37093777238877634.mjs"
28 replies
CDCloudflare Developers
Created by shixzie on 2/22/2023 in #pages-help
Next 13 `app` dir InternalServerError
Hey, I was following the steps described in here https://github.com/cloudflare/next-on-pages to deploy a Next 13 app with the app directory and the response from the server on the / route returns Internal Server Error. I dove into the function logs for the deployment and got the following:
...
"exceptions": [
{
"name": "TypeError",
"message": "undefined is not iterable (cannot read property Symbol(Symbol.iterator))",
"timestamp": 1677101532584
}
],
"logs": [
{
"message": [
"Error: Invariant: AsyncLocalStorage accessed in runtime where it is not available"
],
"level": "error",
"timestamp": 1677101532584
},
{
"message": [
"TypeError: Cannot read properties of null (reading 'default')"
],
"level": "error",
"timestamp": 1677101532584
}
],
...
...
"exceptions": [
{
"name": "TypeError",
"message": "undefined is not iterable (cannot read property Symbol(Symbol.iterator))",
"timestamp": 1677101532584
}
],
"logs": [
{
"message": [
"Error: Invariant: AsyncLocalStorage accessed in runtime where it is not available"
],
"level": "error",
"timestamp": 1677101532584
},
{
"message": [
"TypeError: Cannot read properties of null (reading 'default')"
],
"level": "error",
"timestamp": 1677101532584
}
],
...
I'm not really sure what they are so here I am. I created the project from scratch (ie. npx create-next-app@latest) the appDir experimental config is enabled and basically everything the README says. Appreciate any help.
2 replies