-
Notifications
You must be signed in to change notification settings - Fork 29.9k
Only allow node runtime in proxy #85139
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
Merged
+347
−165
Merged
Changes from 1 commit
Commits
Show all changes
20 commits
Select commit
Hold shift + click to select a range
d74b2cc
Only allow edge runtime in proxy
mischnic 110e473
fixup
mischnic 7c3585b
turbopack
mischnic 9b8c455
override webpack
mischnic 36d287c
print top level issues in handleProjectUpdates
mischnic 4479cd2
Handle for Webpack
devjiwonchoi bc05550
Add nodejs module test
devjiwonchoi 6f0e953
Remove node_env gate
devjiwonchoi af19b91
test: nodejs runtime cannot set draftMode
devjiwonchoi b187b62
test: skip for dev-turbo proxy-runtime
devjiwonchoi 745ae96
Always log from get-page-static as dev-turbo has log bug
devjiwonchoi 73812f3
add comment why errorOnce
devjiwonchoi 8d1c3bb
test: Remove URLPattern usage
devjiwonchoi 1ec9b46
fix text on describe and it
devjiwonchoi f64edae
add handler function check
devjiwonchoi 648e476
isdev
mischnic 9b25f18
Fix proxy renaming
mischnic 470a4ee
fix dev
mischnic 1ba8d90
Rename proxy chunk after the fact
mischnic 9e8dbc9
only rename for webpack
mischnic File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Next
Next commit
Only allow edge runtime in proxy
- Loading branch information
commit d74b2cc534bcfda7d4bf6104c36167ab5b0b3095
Some comments aren't visible on the classic Files Changed page.
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,8 @@ | ||
| import { ReactNode } from 'react' | ||
| export default function Root({ children }: { children: ReactNode }) { | ||
| return ( | ||
| <html> | ||
| <body>{children}</body> | ||
| </html> | ||
| ) | ||
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,3 @@ | ||
| export default function Page() { | ||
| return <p>hello world</p> | ||
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,6 @@ | ||
| /** | ||
| * @type {import('next').NextConfig} | ||
| */ | ||
| const nextConfig = {} | ||
|
|
||
| module.exports = nextConfig |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,43 @@ | ||
| import { nextTestSetup } from 'e2e-utils' | ||
| import stripAnsi from 'strip-ansi' | ||
|
|
||
| describe('proxy-missing-export', () => { | ||
| const { next, isNextDev, skipped } = nextTestSetup({ | ||
| files: __dirname, | ||
| skipDeployment: true, | ||
| skipStart: true, | ||
| }) | ||
|
|
||
| if (skipped) { | ||
| return | ||
| } | ||
|
|
||
| it('should error when proxy file has invalid export named middleware', async () => { | ||
| let cliOutput: string | ||
|
|
||
| if (isNextDev) { | ||
| await next.start().catch(() => {}) | ||
| // Use .catch() because Turbopack errors during compile and exits before runtime. | ||
| await next.browser('/').catch(() => {}) | ||
| cliOutput = next.cliOutput | ||
| } else { | ||
| cliOutput = (await next.build()).cliOutput | ||
| } | ||
|
|
||
| if (process.env.IS_TURBOPACK_TEST) { | ||
| expect(stripAnsi(cliOutput)).toContain(`proxy.ts:3:14 | ||
| Next.js can't recognize the exported \`config\` field in route. Proxy does not support Edge runtime. | ||
| 1 | export default function () {} | ||
| 2 | | ||
| > 3 | export const config = { runtime: 'edge' } | ||
| | ^^^^^^ | ||
| 4 | | ||
|
|
||
| The exported configuration object in a source file needs to have a very specific format from which some properties can be statically parsed at compiled-time.`) | ||
| } else { | ||
| expect(cliOutput).toContain(`Proxy does not support Edge runtime.`) | ||
| } | ||
|
|
||
| await next.stop() | ||
| }) | ||
| }) | ||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,3 @@ | ||
| export default function () {} | ||
|
|
||
| export const config = { runtime: 'edge' } |
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.