Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Conditional page runtime fallback to nodejs #47906

wenerme started this conversation in Ideas
Discussion options

Verify canary release

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

Provide environment information

Operating System:
 Platform: darwin
 Arch: x64
 Version: Darwin Kernel Version 22.3.0: Mon Jan 30 20:42:11 PST 2023; root:xnu-8792813~2/RELEASE_X86_64
 Binaries:
 Node: 18.12.1
 npm: 8.19.2
 Yarn: 1.22.19
 pnpm: 8.1.0
 Relevant packages:
 next: 13.2.4
 eslint-config-next: 13.2.3
 react: 18.2.0
 react-dom: 18.2.0

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

Standalone mode (output: "standalone")

Link to the code that reproduces this issue

https://github.com/wenerme/ChatGPT-Next-Web/blob/b0907ac44fc623b79348bd3fcccff1ad48d712f6/app/api/chat-stream/route.ts#L60-L62

To Reproduce

export const config: PageConfig = {
 runtime: process.env.NEXT_RUNTIME,
};

Unsupported node type "MemberExpression"

Or

export const config: PageConfig = {
 runtime: process.env.STANDALONE ? "nodejs" : "edge",
};

Unsupported node type "ConditionalExpression"

Describe the Bug

PageConfig should allowed simple expression

Expected Behavior

Conditional page runtime works as expected

Which browser are you using? (if relevant)

No response

How are you deploying your application? (if relevant)

No response

You must be logged in to vote

Replies: 1 comment

Comment options

I Second this.
With 'experimental-edge', local dev mode fails with 'Internal Server Error'. Without the setting, cloudflare complaints and fails to build.
Is there a way to rewrite the setting dynamically?

You must be logged in to vote
0 replies
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Ideas
Labels
bug Issue was opened via the bug report template. Output Related to the the output configuration option.
Converted from issue

This discussion was converted from issue #47890 on April 04, 2023 12:11.

AltStyle によって変換されたページ (->オリジナル) /