Skip to content

Commit 6e5fd8f

Browse files
fix: get next config before requiring devserver (#15885)
* fix: get next config before requiring devserver * lint Co-authored-by: Lachlan Miller <lachlan.miller.1990@outlook.com>
1 parent cb9faa8 commit 6e5fd8f

File tree

1 file changed

+6
-2
lines changed

1 file changed

+6
-2
lines changed

npm/react/plugins/next/index.js

+6-2
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,13 @@
1-
const { startDevServer } = require('@cypress/webpack-dev-server')
21
const findNextWebpackConfig = require('./findNextWebpackConfig')
32

43
module.exports = (on, config) => {
54
on('dev-server:start', async (options) => {
6-
return startDevServer({ options, webpackConfig: await findNextWebpackConfig(config) })
5+
const webpackConfig = await findNextWebpackConfig(config)
6+
7+
// require('webpack') now points to nextjs bundled version
8+
const { startDevServer } = require('@cypress/webpack-dev-server')
9+
10+
return startDevServer({ options, webpackConfig })
711
})
812

913
config.env.reactDevtools = true

0 commit comments

Comments
 (0)