Skip to content
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

The gRPC binary module was not installed. This may be fixed by running "npm rebuild" #7821

Closed
skaptox opened this issue Jul 9, 2019 · 8 comments · Fixed by #8246
Closed
Milestone

Comments

@skaptox
Copy link

skaptox commented Jul 9, 2019

Bug report

Describe the bug

Hello, I'm getting this error trying run yarn build. I want to deploy to now.sh my ssr app with firebase and antd. I tried npm i && npm rebuild && npm run build but it didn't work.

Solutions to another issues have not working.

gitpod /workspace/shopping $ yarn build
yarn run v1.16.0
warning package.json: No license field
$ next build
Creating an optimized production build ...

Using external babel configuration
Location: "/workspace/shopping/.babelrc"
Compiled with warnings.

./node_modules/bytebuffer/dist/bytebuffer-node.js
Module not found: Can't resolve 'memcpy' in '/workspace/shopping/node_modules/bytebuffer/dist'

Build error occurred
{ Error: The gRPC binary module was not installed. This may be fixed by running "npm rebuild"
Original error: Cannot find module './assets/src/node/extension_binary/node-v64-linux-x64-glibc/grpc_node.node'
at Object.L/Cg (/workspace/shopping/.next/serverless/pages/index.js:48582:17)
at webpack_require (/workspace/shopping/.next/serverless/pages/index.js:23:31)
at Object.7noQ (/workspace/shopping/.next/serverless/pages/index.js:7759:12)
at webpack_require (/workspace/shopping/.next/serverless/pages/index.js:23:31)
at Object.cJE4 (/workspace/shopping/.next/serverless/pages/index.js:62556:27)
at webpack_require (/workspace/shopping/.next/serverless/pages/index.js:23:31)
at Object.z77n (/workspace/shopping/.next/serverless/pages/index.js:75069:14)
at webpack_require (/workspace/shopping/.next/serverless/pages/index.js:23:31)
at Object.BYZf (/workspace/shopping/.next/serverless/pages/index.js:12181:12)
at webpack_require (/workspace/shopping/.next/serverless/pages/index.js:23:31) code: 'MODULE_NOT_FOUND' }
error Command failed with exit code 1.
info Visit https://yarnpkg.com/en/docs/cli/run for documentation about this command.

To Reproduce

Steps to reproduce the behavior, please provide code snippets or a repository:

  1. Clone this repo
  2. yarn && yarn build
  3. See error

System information

  • OS: [e.g. Linux]
  • Version of Next.js: 9.0.0
  • Node v10.15.3
@yalamber
Copy link

yalamber commented Jul 9, 2019

I am having similar issue with latest next.js I get following error when building

Build error occurred
{ Error: Failed to load D:\Our-Projects\nepal-photo-tours\node_modules\grpc\src\node\extension_binary\node-v64-win32-x64-unknown\grpc_node.node. Module did not self-register.

@danoc
Copy link

danoc commented Jul 13, 2019

Do you use yarn? If so, try yarn install --force.

@Vista1nik
Copy link

@danoc it's same. Recompile of packages does'nt help.

@0x80
Copy link
Contributor

0x80 commented Aug 8, 2019

@Timer I've tried the canary version and set target to "experimental-serverless-trace" but I still get this error

Build error occurred
{ Error: Failed to load /Users/me/myproject/node_modules/grpc/src/node/extension_binary/node-v64-darwin-x64-unknown/grpc_node.node. Module did not self-register.
at Object.Module._extensions..node (internal/modules/cjs/loader.js:718:18)

Did you expect this to be resolved or could it be unrelated?

@Timer
Copy link
Member

Timer commented Aug 8, 2019

@0x80 please open a new issue with a full reproduction and we can take a look.

@Timer Timer added this to the 9.0.4 milestone Aug 8, 2019
@0x80
Copy link
Contributor

0x80 commented Aug 8, 2019

@Timer It seems very hard to isolate the problem. I started out with a bare simple starter repo, adding code and dependencies and matching configs, but everything kept working.

When I ran out of ideas I went the other way around, starting from my full app and cutting away things. Then I discovered something very strange. Say in my pages directory I have pages A,B,C,D,E,F. It appears that if I remove either one of them, my app builds without error. But if I try to build with all pages the error returns. It's also not a question of odd/even because if I just duplicate one page like A,A*,B,C,D,E,F I still get the error.

I was hoping you can give me a clue since you understand the build process. To me this is super weird behaviour and I don't know that to try next...

@yalamber Since you had the same error as me, maybe you can also try to build your app with canary and the new target setting. You might have more luck then me 😄

@0x80
Copy link
Contributor

0x80 commented Aug 13, 2019

My issue was resolved with this PR which is part of canary.3. Glad I didn't spend more time chasing this, because I wouldn't have never found the cause.

@balazsorban44
Copy link
Member

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.

@vercel vercel locked as resolved and limited conversation to collaborators Jan 31, 2022
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
7 participants