Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[🐛 Bug]: nextjs local preview succeeded, deployment succeeded, but no deployment was shown #740

Open
1 task
hehehai opened this issue Apr 10, 2024 · 15 comments
Labels
bug Something isn't working

Comments

@hehehai
Copy link

hehehai commented Apr 10, 2024

next-on-pages environment related information

System:
Platform: darwin
Arch: x64
Version: Darwin Kernel Version 23.1.0: Mon Oct 9 21:27:27 PDT 2023; root:xnu-10002.41.9~6/RELEASE_X86_64
CPU: (16) x64 Intel(R) Core(TM) i9-9880H CPU @ 2.30GHz
Memory: 32 GB
Shell: /bin/zsh
Package Manager Used: npm (10.1.0)

Relevant Packages:
@cloudflare/next-on-pages: 1.11.0
vercel: N/A
next: N/A

Description

developed the nextjs project, using pages deployment, the first deployment was successful, but after my subsequent modifications, the deployment was successful, but accessing pages failed

image

Reproduction

https://github.com/hehehai/at4-kit

name = "at4-start"
compatibility_date = "2024-04-05"
compatibility_flags = ["nodejs_compat"]

[vars]
NEXT_PUBLIC_CLERK_PUBLISHABLE_KEY = "pk_test_xx"
CLERK_SECRET_KEY = "sk_test_xx"

[[d1_databases]]
binding = "DB" # i.e. available in your Worker on env.DB
database_name = "prisma-demo-db"
database_id = "xx"
"pages:build": "npx @cloudflare/next-on-pages",
"preview": "npm run pages:build && wrangler pages dev .vercel/output/static",
"deploy": "npm run pages:build && wrangler pages deploy .vercel/output/static",
"build-cf-types": "wrangler types --env-interface CloudflareEnv env.d.ts"

Pages Deployment Method

None

Pages Deployment ID

at4-start

Additional Information

No response

Would you like to help?

  • Would you like to help fixing this bug?
@hehehai hehehai added the bug Something isn't working label Apr 10, 2024
@hehehai
Copy link
Author

hehehai commented Apr 11, 2024

image image

@liuhenry
Copy link

I'm running into the same issue. However, manually uploading the .vercel/output/static folder into the Cloudflare dashboard seems to work.

In particular, that upload has a _worker.js folder that's missing from the CLI upload, even though it seems to show up under "Attaching additional modules:", so maybe that's broken?

@hehehai
Copy link
Author

hehehai commented Apr 12, 2024

@liuhenry Yes, I have used manual upload, but I have the same problem. I think it is the built file that is not parsed properly. Pages does not think it is a service.

@james-elicx
Copy link
Contributor

Manual upload won't deploy the worker, it will just upload everything as static assets. The _worker.js folder should not be shown in your list of assets on Pages.

Please can you share deployment IDs for the failing deployments?

@hehehai
Copy link
Author

hehehai commented Apr 13, 2024

@james-elicx What is the id you are talking about? Is it this one?

at4-start.pages.dev

image

Twice I modified the path, and the path was changed to, He successfully displayed the deployment preview address, but it was inaccessible (this is normal)

"deploy": "npm run pages:build && wrangler pages deploy .vercel/output",

Previously, I used full stack Next.js to initialize the project, and the deployment was normal

@hehehai
Copy link
Author

hehehai commented Apr 19, 2024

@james-elicx Hello, would like to know if there are any current solutions or suggestions for this problem?

@hocgin
Copy link

hocgin commented Apr 19, 2024

Do you have a solution when I encounter the same situation?

@hocgin
Copy link

hocgin commented Apr 20, 2024

@james-elicx

I guess the reason for the problem is caused by a combination of nextjs, Prisma, and d1.

This is the smallest problem reproduction demo I have created: https://github.com/hocgin/issue-cloudflare-nextjs-prisma-d1

Where the problem occurred: https://github.com/hocgin/issue-cloudflare-nextjs-prisma-d1/blob/bbc5013d02487554ac39f494ee3f4017cb416485/app/api/hello/route.ts#L12

Deployment ID: 6b32578d-be85-4bf0-9310-e518b5c451dd

Looking forward to receiving a solution to the problem

@hehehai
Copy link
Author

hehehai commented Apr 21, 2024

Do you have a solution when I encounter the same situation?

No, it's on hold

@LightBounded
Copy link

Getting this same issue as well but when using Drizzle ORM in an RSC.

@bradens
Copy link

bradens commented Apr 21, 2024

Same

@juanferreras
Copy link
Contributor

@hehehai I've had a similar issue than you (build does not error, deploy does not error , but the deployment appears fully broken with all paths returning 404).

I've created a PR that makes sure the build exits with code 1 when erroring unexpectedly. If this is the exact same issue you and the other users are having, there's obviously still something that is causing the build to fail and this PR will just make sure it doesn't go through as a broken deployment causing an incident.

It'd be helpful to see your pages:build logs, specially after ▲ Build Completed in .vercel/output [4m]

▲ Collected static files (public/, static/, .next/static): 59.326ms
▲ Build Completed in .vercel/output [4m]
⚡️ Completed `pnpm dlx vercel build`.
⚡️ Unexpected error: <----- do you have something like this?

@hehehai
Copy link
Author

hehehai commented Apr 22, 2024

@hehehai I've had a similar issue than you (build does not error, deploy does not error , but the deployment appears fully broken with all paths returning 404).

I've created a PR that makes sure the build exits with code 1 when erroring unexpectedly. If this is the exact same issue you and the other users are having, there's obviously still something that is causing the build to fail and this PR will just make sure it doesn't go through as a broken deployment causing an incident.

It'd be helpful to see your pages:build logs, specially after ▲ Build Completed in .vercel/output [4m]

▲ Collected static files (public/, static/, .next/static): 59.326ms
▲ Build Completed in .vercel/output [4m]
⚡️ Completed `pnpm dlx vercel build`.
⚡️ Unexpected error: <----- do you have something like this?

@juanferreras No, it's like this

▲  ƒ Middleware                             222 kB
▲  ℇ  (Edge Runtime)  server-rendered on demand using the Edge Runtime
▲  Traced Next.js server files in: 336.634ms
▲  Created all serverless functions in: 362.769ms
▲  Collected static files (public/, static/, .next/static): 5.529ms
▲  Build Completed in .vercel/output [37s]
⚡️ Completed `pnpm exec vercel build`.

⚡️ Build Summary (@cloudflare/next-on-pages v1.11.0)
⚡️
⚡️ Middleware Functions (1)
⚡️   - src/middleware
⚡️
⚡️ Edge Function Routes (7)

...
✨ Deployment complete! Take a peek over at https://5585e299.at4-start.pages.dev

@hehehai
Copy link
Author

hehehai commented Apr 30, 2024

@juanferreras Any solutions or plans for liberation? Do you know the specific reason now? If it cannot be reproduced, can I use the repo reproduction I provide?

@LightBounded
Copy link

Still getting this same issue. Has anyone found a solution or reason for why this is happening?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

7 participants