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

Next 13.4.10-canary.3 Standalone mode breaks app #52615

Closed
1 task done
khuezy opened this issue Jul 13, 2023 · 7 comments
Closed
1 task done

Next 13.4.10-canary.3 Standalone mode breaks app #52615

khuezy opened this issue Jul 13, 2023 · 7 comments
Labels
bug Issue was opened via the bug report template. locked Output (export/standalone) Related to the the output option in `next.config.js`. please add a complete reproduction The issue lacks information for further investigation

Comments

@khuezy
Copy link
Contributor

khuezy commented Jul 13, 2023

Verify canary release

  • I verified that the issue exists in the latest Next.js canary release

Provide environment information

N/A

Which area(s) of Next.js are affected? (leave empty if unsure)

Standalone mode (output: "standalone")

Link to the code that reproduces this issue or a replay of the bug

Reproduction Repo

To Reproduce

This setup deploys Nextjs as a standalone app running on AWS. So you need to have your ~/.aws/credentials set up in order to deploy the app

  1. pnpm install
  2. npx sst deploy --stage dev
  3. wait for deployment
  4. go to the outputted CloudFront URL
  5. Notice Internal Server Error
  6. Check CloudWatch logs, it should be something like the logs below
  7. to clean up, run npx sst remove --stage dev

Question: Why is it trying to load react/jsx-runtime?

@logstream
2023/07/13/[$LATEST]aaa75d180aaf...
@message
2023-07-13T00:37:28.806Z undefined ERROR Failed to override Next.js require hooks. Error: Cannot find module '/var/task/node_modules/react/jsx-runtime.js'
at createEsmNotFoundErr (node:internal/modules/cjs/loader:1096:15)
at finalizeEsmResolution (node:internal/modules/cjs/loader:1089:15)
at resolveExports (node:internal/modules/cjs/loader:565:14)
at Module._findPath (node:internal/modules/cjs/loader:634:31)
at Module._resolveFilename (node:internal/modules/cjs/loader:1061:27)
at /var/task/node_modules/next/dist/server/require-hook.js:1:3469
at Function.resolve (node:internal/modules/cjs/helpers:116:19)
at hse (file:///var/task/packages/app/index.mjs:31:7405)
at gj (file:///var/task/packages/app/index.mjs:31:7019)
at file:///var/task/packages/app/index.mjs:31:10451 {
code: 'MODULE_NOT_FOUND',
path: '/var/task/node_modules/react/package.json'
}

Describe the Bug

Most likely introduced in this PR: #52206

Expected Behavior

Standalone deployments should work. 13.4.10-canary.2 works but not 3 and above.

Which browser are you using? (if relevant)

No response

How are you deploying your application? (if relevant)

Deploying Standalone Mode to AWS via SST and OpenNext

@khuezy khuezy added the bug Issue was opened via the bug report template. label Jul 13, 2023
@github-actions github-actions bot added the Output (export/standalone) Related to the the output option in `next.config.js`. label Jul 13, 2023
@balazsorban44 balazsorban44 added the please add a complete reproduction The issue lacks information for further investigation label Jul 13, 2023
@github-actions
Copy link
Contributor

We cannot recreate the issue with the provided information. Please add a reproduction in order for us to be able to investigate.

Why was this issue marked with the please add a complete reproduction label?

To be able to investigate, we need access to a reproduction to identify what triggered the issue. We prefer a link to a public GitHub repository (template for pages, template for App Router), but you can also use these templates: CodeSandbox: pages or CodeSandbox: App Router.

To make sure the issue is resolved as quickly as possible, please make sure that the reproduction is as minimal as possible. This means that you should remove unnecessary code, files, and dependencies that do not contribute to the issue.

Please test your reproduction against the latest version of Next.js (next@canary) to make sure your issue has not already been fixed.

I added a link, why was it still marked?

Ensure the link is pointing to a codebase that is accessible (e.g. not a private repository). "example.com", "n/a", "will add later", etc. are not acceptable links -- we need to see a public codebase. See the above section for accepted links.

What happens if I don't provide a sufficient minimal reproduction?

Issues with the please add a complete reproduction label that receives no meaningful activity (e.g. new comments with a reproduction link) are automatically closed and locked after 30 days.

If your issue has not been resolved in that time and it has been closed/locked, please open a new issue with the required reproduction.

I did not open this issue, but it is relevant to me, what can I do to help?

Anyone experiencing the same issue is welcome to provide a minimal reproduction following the above steps. Furthermore, you can upvote the issue using the 👍 reaction on the topmost comment (please do not comment "I have the same issue" without reproduction steps). Then, we can sort issues by votes to prioritize.

I think my reproduction is good enough, why aren't you looking into it quicker?

We look into every Next.js issue and constantly monitor open issues for new comments.

However, sometimes we might miss one or two due to the popularity/high traffic of the repository. We apologize, and kindly ask you to refrain from tagging core maintainers, as that will usually not result in increased priority.

Upvoting issues to show your interest will help us prioritize and address them as quickly as possible. That said, every issue is important to us, and if an issue gets closed by accident, we encourage you to open a new one linking to the old issue and we will look into it.

Useful Resources

@khuezy
Copy link
Contributor Author

khuezy commented Jul 13, 2023

Hey sorry, I added a reproduction repo.

@khuezy
Copy link
Contributor Author

khuezy commented Jul 13, 2023

If the removal of the jsx-runtime is intentional, then I'll close this issue.

@feedthejim
Copy link
Contributor

@khuezy can you provide a repro that does not involve SST to help us triage if it's a SST bug or not?

@wssjq198913
Copy link

@khuezy i have exactly the same issue, don't know what to do.

@khuezy
Copy link
Contributor Author

khuezy commented Jul 15, 2023

@feedthejim thanks for replying. I'll close this as it's not a nextjs issue.

@wssjq198913 if you're using SST, this PR should fix it: sst/open-next#159

@khuezy khuezy closed this as completed Jul 15, 2023
@github-actions
Copy link
Contributor

This closed issue has been automatically locked because it had no new activity for a month. If you are running into a similar issue, please create a new issue with the steps to reproduce. Thank you.

@github-actions github-actions bot locked as resolved and limited conversation to collaborators Aug 15, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
bug Issue was opened via the bug report template. locked Output (export/standalone) Related to the the output option in `next.config.js`. please add a complete reproduction The issue lacks information for further investigation
Projects
None yet
Development

No branches or pull requests

4 participants