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

Nextjs Server Actions fail #3758

Closed
5 tasks done
Zeedinstein opened this issue Oct 12, 2023 · 4 comments
Closed
5 tasks done

Nextjs Server Actions fail #3758

Zeedinstein opened this issue Oct 12, 2023 · 4 comments
Labels
archived This issue has been locked. closed-for-staleness pending-triage response-requested Waiting on additional info and feedback. Will move to "closing-soon" in 7 days.

Comments

@Zeedinstein
Copy link

Before opening, please confirm:

  • I have checked to see if my question is addressed in the FAQ.
  • I have searched for duplicate or closed issues.
  • I have read the guide for submitting bug reports.
  • I have done my best to include a minimal, self-contained set of instructions for consistently reproducing the issue.
  • I have removed any sensitive information from my code snippets and submission.

App Id

d2ke7czr1ze2b2

AWS Region

eu-west-1

Amplify Hosting feature

SSR

Frontend framework

Next.js

Next.js version

18.18.1

Next.js router

App Router

Describe the bug

Server Actions fail when hosting with Amplify.

I'm using NextJS 13.5.4

Expected behavior

Expect the server action to run successfully.

Reproduction steps

  1. Create a NextJS app with version 13.5.4
  2. Create a server action for a page
  3. Execute the action to call the server action
  4. Receive a 500 error from the request

Build Settings

version: 1
frontend:
  phases:
    preBuild:
      commands:
        - npm ci
    build:
      commands:
        - env | grep -e API >> .env.production
        - npm run build
  artifacts:
    baseDirectory: .next
    files:
      - '**/*'
  cache:
    paths:
      - node_modules/**/*

Log output

# Put your logs below this line


TypeError: Cannot read properties of undefined (reading 'workers')
--
at /var/task/node_modules/next/dist/compiled/next-server/app-page-experimental.runtime.prod.js:117:5940
at processTicksAndRejections (node:internal/process/task_queues:96:5)
at async t2 (/var/task/node_modules/next/dist/compiled/next-server/app-page-experimental.runtime.prod.js:117:4679)
at async H (/var/task/node_modules/next/dist/compiled/next-server/app-page-experimental.runtime.prod.js:117:29657)
at async doRender (/var/task/node_modules/next/dist/server/base-server.js:1294:26)
at async cacheEntry.responseCache.get.incrementalCache.incrementalCache (/var/task/node_modules/next/dist/server/base-server.js:1446:28)
at async /var/task/node_modules/next/dist/server/response-cache/index.js:102:36



Additional information

No response

@Zeedinstein Zeedinstein changed the title NextJS Server Actions fail Nextjs Server Actions fail Oct 12, 2023
@Zeedinstein
Copy link
Author

Seems like adding no-cache to the fetch request in the server actions fixed my issue. So it seems like the cache was actually causing the problem.

@siegerts
Copy link
Contributor

Hi @Zeedinstein, thanks for opening this. Are you able to share the pre/post request. Just want to make sure that we can reproduce with within the context of your scenario. Thanks!

@siegerts siegerts added the response-requested Waiting on additional info and feedback. Will move to "closing-soon" in 7 days. label Oct 19, 2023
@github-actions
Copy link

This issue has not received a response in a while. If you want to keep this issue open, please leave a comment below and auto-close will be canceled.

@github-actions github-actions bot added closing-soon This issue will automatically close in 4 days unless further comments are made. closed-for-staleness and removed closing-soon This issue will automatically close in 4 days unless further comments are made. labels Oct 22, 2023
@github-actions
Copy link

This issue has been automatically locked.

@github-actions github-actions bot added the archived This issue has been locked. label Oct 26, 2023
@github-actions github-actions bot locked and limited conversation to collaborators Oct 26, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
archived This issue has been locked. closed-for-staleness pending-triage response-requested Waiting on additional info and feedback. Will move to "closing-soon" in 7 days.
Projects
None yet
Development

No branches or pull requests

2 participants