-
Notifications
You must be signed in to change notification settings - Fork 27k
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
segfault running custom next server within jest unit test after upgrading nextjs 11 -> 12 #33008
Comments
Me too! I'm trying next 12.0.7 with Node 17 and 16. Your fix solved it. Except, instead of import conf from '../next.config.js'
...
export const nextApp = next({ dev: isDevelopment, conf }) and now, 100% less seg faults. |
It looks like the error comes from here: https://cs.github.com/v8/v8/blob/17a99fec258bcc07ea9fc5e4fabcce259751db03/src/runtime/runtime-module.cc?q=RunHostImportModuleDynamicallyCallback+DynamicImportCall#L43-L44 I haven't looked very closely at it since this isn't an urgent/significant issue for me but I suspect using d8 will be helpful to inspect program state since the call stack is in an async/await trampoline. |
Same issue reported here #31162 |
Duplicate of #31162 |
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. |
Run
next info
(available from version 12.0.8 and up)N/A
What version of Next.js are you using?
11.1.3 + 12.0.7
What version of Node.js are you using?
16.13.1
What browser are you using?
N/A
What operating system are you using?
macOS
How are you deploying your application?
N/A
Describe the Bug
Within a custom server application there are some unit tests using the jest framework along with supertest to mimic http requests (See replication repo). This has been working as expected up until trying to upgrade to multiple 12.X nextjs versions including
12.0.0
,12.0.1
, and12.0.7
.When running version 12 with a
next.config.js
configuration present and a custom server withdev: false
, the jest execution exits with a segfault when callingapp.prepare()
.zsh: segmentation fault npm test
It is possible to workaround this issue by importing the nextjs config manually and passing it as the
conf
option to the custom next application.example workaround
Expected Behavior
I would expect this not to crash and nextjs to be able to resolve the
next.config.js
automatically without the conf optionTo Reproduce
I have published a public GitHub repo that reproduces the following scenarios along with setup instructions
https://github.com/Kauabunga/nextjs-replicate-segfault-custom-server-v12
next.config.js
next.config.js
next.config.js
next.config.js
next.config.js
with custom server optionsconf: require('next.config')
next.config.js
andsegfault-handler
The text was updated successfully, but these errors were encountered: