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
Fix missing error when using Actions on the client layer without enabling the feature flag #50257
Changes from all commits
facb3d6
2ddfa81
c51c9f6
7d44f1d
8424f52
d9e3343
df5ff25
b736807
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -23,8 +23,6 @@ addHookAliases([ | |
['styled-jsx', require.resolve('styled-jsx')], | ||
['styled-jsx/style', require.resolve('styled-jsx/style')], | ||
['styled-jsx/style', require.resolve('styled-jsx/style')], | ||
['server-only', require.resolve('next/dist/compiled/server-only')], | ||
['client-only', require.resolve('next/dist/compiled/client-only')], | ||
Comment on lines
-26
to
-27
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. This is flawed because the require hook is executed in a normal Node.js process, not during build so there's no server/client layer involved. So that There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Thanks for fixing this |
||
]) | ||
|
||
// Override built-in React packages if necessary | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,41 @@ | ||
import { createNextDescribe } from 'e2e-utils' | ||
|
||
createNextDescribe( | ||
'app-dir action invalid config', | ||
{ | ||
files: __dirname, | ||
skipDeployment: true, | ||
dependencies: { | ||
react: 'latest', | ||
'react-dom': 'latest', | ||
'server-only': 'latest', | ||
}, | ||
}, | ||
({ next, isNextStart }) => { | ||
if (!isNextStart) { | ||
it('skip test for dev mode', () => {}) | ||
return | ||
} | ||
|
||
beforeAll(async () => { | ||
await next.stop() | ||
await next.patchFile( | ||
'next.config.js', | ||
` | ||
module.exports = { | ||
experimental: {}, | ||
} | ||
` | ||
) | ||
try { | ||
await next.build() | ||
} catch {} | ||
}) | ||
|
||
it('should error if serverActions is not enabled', async () => { | ||
expect(next.cliOutput).toContain( | ||
'Server Actions require `experimental.serverActions` option' | ||
) | ||
}) | ||
} | ||
) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Renamed as it no longer contains React specific aliases, but also
server-only
andclient-only
.