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] Error: Dynamic require of "/.next/server/pages/api/hello.js" is not supported #442

Open
jeff-polls opened this issue Mar 8, 2025 · 0 comments
Labels
bug Something isn't working triage

Comments

@jeff-polls
Copy link

Describe the bug

500 error when pinging API routes in cloudflare preview mode, works when running next dev

I'm using the latest starter template with no changes:
yarn create cloudflare my-next-app --framework=next --experimental

I'm on a mac running Ventura, tried on node 20 and 22.

Steps to reproduce

yarn create cloudflare my-next-app --framework=next --experimental

Then run yarn preview

I can see the static page in the browser (although images and icons are broken), but when I try to ping the /api/hello endpoint I get a 500.

Expected behavior

The API routes in the example project should work

@opennextjs/cloudflare version

0.5.8

Wrangler version

3.114.0

next info output

✘ [ERROR] ⨯ Error: Dynamic require of "/.next/server/pages/api/hello.js" is not supported

Additional context

No response

@jeff-polls jeff-polls added bug Something isn't working triage labels Mar 8, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working triage
Projects
None yet
Development

No branches or pull requests

1 participant