-
Notifications
You must be signed in to change notification settings - Fork 27.5k
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
next build
fails with "Module did not self-register."
#7894
Comments
Please provide a full reproduction |
I'll provide reproduction tomorrow. Today I don't have access to my pc. |
Close because it's firebase grpc problem. |
There is similar problem in #7821 |
How can i fixed it? |
@go-rani Currently I don't have a solution because I not fully sure that this problem belongs to firebase. I trying to reproduce this bug in example project. |
I have the same problem. It goes normal when I downgrade to v8 |
@vbilici interesting... |
I have a feeling that it's caused by newly added build report. Because the error throws after build completes
|
I'm having same issue. But when I comment out 'import firebase/firestore', this issue did'nt happen.
But I need firebase/firestore. this is not solution. |
As I understand any dependency with grpc breaking nextjs build? |
Getting this issue as well. I was able to build at first, but it happens when my /pages grown big. I tried reverting back to an old commit where i can build without issue and duplicate my /pages folder (-v1, -v2 and so on) build after build to a point where it fails. I couldn't quantify how "big" is big but hope this helps. |
@timneutkens @Vista1nik I've created a reproduction here https://github.com/jpbow/module-register-build-issue |
@jpbow Thanks for repoduction, added to issue. |
just chiming in, this also fails when deploying with now 2.0 |
It's seems like NextJS 9 is incompatible with dependencies which use GRPC in anyway. |
@Vista1nik it'll fail with both firebase and gcp. Both use grpc. |
after updating my next.config.js with the following (as mentioned in #6073 )
link: #6073 (comment) My deployment error has changed, I don't think this is optimal but may be a temporary workaround for others who are trying to update production builds the new error seems related to AMP toolbox,
which is annoying as I'm not using AMP at all, not sure how related this is but hopefully its helpful. |
I am having the same issue using firebase.. Has anyone found a deployment workaround? |
For some reason building my project on mac OS works, while on Debian I get the same "Module did not self-register" error. |
Did anyone found any workaround for this issue? |
There must be joke about "Buy new Mac". |
Try to remove this import : import "firebase/firestore"; only in index.js |
@notiles if you remove one of the two As mentioned above I'm pretty confident that the issue we are observing here is caused by grpc/grpc-node#778 which states that As a workaround I figured out that builds succeed with the following module.exports = {
experimental: {
cpus: 1,
},
}; and fail as soon as you increase the CPU count (which further proves that parallel worker execution is the root cause). Obviously builds will then no longer take advantage of multiple worker threads, so this is a workaround, not a solution. @ijjk, @Timer, @timneutkens sorry for bugging you again: how would you deal with this issue? |
It's clear @ctavan ! Thanks a lot for this explanation. Unfortunately I still have the issue with experimental: { `Warning: You have enabled experimental feature(s).
Compiled successfully. Automatically optimizing pages .. etc...` I switch form Node 11.9.0 to Node 10.12 and Node 13.0.1 to Node 12.13.0 without success... |
I was a bit too quick. With the My initial idea was to pass the The only way of getting it to work for my use case was setting A possible workaround could be to allow setting |
Ok @ctavan ! That's totally true, I change enableWorkerThreads to false and build succeed with next 9.1.1 So finally it's more a grpc issue than a next issue ? What's your feeling about that ? Do you think that we have to open an issue on grpc ? Thanks a lots for all your explanations that's really helpfull. |
Multiple worker threads can cause problems when certain dependencies are being used, see e.g. vercel#7894 This patch allows disabling of worker threads by setting `config.experimental.cpus = 1`. The benefit of spawning 1 worker thread, if there is any at all, should very limited anyways, so the workload can just as well be processed in the main thread.
I have now proposed #9199 where setting For me, that would be an acceptable workaround until the issue is fixed in I now believe that this is something that rather needs to be fixed in If #9199 gets accepted we would at least have a way to build projects that depend on |
Multiple worker threads can cause problems when certain dependencies are being used, see e.g. vercel#7894 This patch allows disabling of worker threads by setting `config.experimental.cpus = 1`. The benefit of spawning 1 worker thread, if there is any at all, should very limited anyways, so the workload can just as well be processed in the main thread.
Multiple worker threads can cause problems when certain dependencies are being used, see e.g. vercel#7894 This patch allows disabling of worker threads by setting `config.experimental.cpus = 1`. The benefit of spawning 1 worker thread, if there is any at all, should very limited anyways, so the workload can just as well be processed in the main thread.
* Pass config.experimental.cpus to export during build Currently, there is no way of specifying the number of worker threads of `next export` when run as part of `next build`. I suggest a sane default should be to just use the same amount of workers that were used during the build process which currently seems to be configured through `config.experimental.cpus`. This setting is already respected in the two other places where jest-workers are in use: The TerserPlugin and the staticCheckWorkers in `next build`. * Only enable worker threads if there is more than 1 worker Multiple worker threads can cause problems when certain dependencies are being used, see e.g. #7894 This patch allows disabling of worker threads by setting `config.experimental.cpus = 1`. The benefit of spawning 1 worker thread, if there is any at all, should very limited anyways, so the workload can just as well be processed in the main thread. * Disable parallel build for firebase authentication example * Add integration test to cover #7894 * Rename test suite and add worker_threads config * Disable worker_threads by default * Update index.test.js * Use workerThreads config for TerserPlugin * Update to use workerThreads config in TerserPlugin for consistency * Disable node 12 specific test
…ったのでnextjsをバージョンアップ(9.1.2) vercel/next.js#7894
The canvas package, which is a dependency of jsdom, has a native binding which causes the following error during Next.js build process: "Module did not self-register". We circuvent that by using a null-loader. See vercel/next.js#7894 The ws package, which is also a dependency of jsdom, tries to optionally load some dependencies. This produces a warning in webpack that we want to avoid. We circuvent that by adding them to externals.
The canvas package, which is a dependency of jsdom, has a native binding which causes the following error during Next.js build process: "Module did not self-register". We circuvent that by using a null-loader. See vercel/next.js#7894 The ws package, which is also a dependency of jsdom, tries to optionally load some dependencies. This produces a warning in webpack that we want to avoid. We circuvent that by adding them to externals.
The canvas package, which is a dependency of jsdom, has a native binding which causes the following error during Next.js build process: "Module did not self-register". We circuvent that by using a null-loader. See vercel/next.js#7894 The ws package, which is also a dependency of jsdom, tries to optionally load some dependencies. This produces a warning in webpack that we want to avoid. We circuvent that by adding them to externals.
The canvas package, which is a dependency of jsdom, has a native binding which causes the following error during Next.js build process: "Module did not self-register". We circuvent that by using a null-loader. See vercel/next.js#7894 The ws package, which is also a dependency of jsdom, tries to optionally load some dependencies. This produces a warning in webpack that we want to avoid. We circuvent that by adding them to externals.
HEY EVERYBODY! "engines": { To your package.json You are welcome coders. |
for anyone else who was tracking this issue: I can confirm I no longer get "Module did not self-register" when using grpc. |
I have the same error
|
This issue has been automatically locked due to no recent activity. If you are running into a similar issue, please create a new issue with the steps to reproduce. Thank you. |
Bug report
Describe the bug
next build
fails with following error after upgrade to Next 9.Error happens after compilation.
Last Build trigger before error is:
https://github.com/zeit/next.js/blob/5a54e8715a7a7a92175addc19f4ec9f8f7bbd2e7/packages/next/build/index.ts#L342
To Reproduce
https://github.com/jpbow/module-register-build-issue
Expected behavior
next build
successSystem information
Additional context
Tried
yarn install --force
and Clean depends install.next .
dev-command work properly.The text was updated successfully, but these errors were encountered: