nodejs changes between 0.16.1 and 0.17.x
What happened?
nodejs app was running fine and then the upgrade in nodejs buildpack caused errors around missing private libraries locally and on cloudbuild it threw errors around react. https://reactjs.org/warnings/invalid-hook-call-warning.html#duplicate-react
- What were you attempting to do?
just deploying with latest version and the version changed.
- What did you expect to happen?
shouldn't cause build issues as environments change
- What was the actual behavior? Please provide log output, if possible.
web: Error occurred prerendering page "/health". Read more: https://nextjs.org/docs/messages/prerender-error web: Error: Invalid hook call. Hooks can only be called inside of the body of a function component. This could happen for one of the following reasons: web: 1. You might have mismatching versions of React and the renderer (such as React DOM) web: 2. You might be breaking the Rules of Hooks web: 3. You might have more than one copy of React in the same app web: See https://reactjs.org/link/invalid-hook-call for tips about how to debug and fix this problem. web: at resolveDispatcher (/layers/paketo-buildpacks_yarn-install/build-modules/node_modules/react/cjs/react.development.js:1476:13) web: at useState (/layers/paketo-buildpacks_yarn-install/build-modules/node_modules/react/cjs/react.development.js:1507:20) web: at GoNoodle (/workspace/apps/web/.next/server/pages/_app.js:357:42) web: at processChild (/layers/paketo-buildpacks_yarn-install/launch-modules/node_modules/react-dom/cjs/react-dom-server.node.development.js:3353:14) web: at resolve (/layers/paketo-buildpacks_yarn-install/launch-modules/node_modules/react-dom/cjs/react-dom-server.node.development.js:3270:5) web: at ReactDOMServerRenderer.render (/layers/paketo-buildpacks_yarn-install/launch-modules/node_modules/react-dom/cjs/react-dom-server.node.development.js:3753:22) web: at ReactDOMServerRenderer.read (/layers/paketo-buildpacks_yarn-install/launch-modules/node_modules/react-dom/cjs/react-dom-server.node.development.js:3690:29) web: at renderToString (/layers/paketo-buildpacks_yarn-install/launch-modules/node_modules/react-dom/cjs/react-dom-server.node.development.js:4298:27) web: at Object.renderPage (/layers/paketo-buildpacks_yarn-install/launch-modules/node_modules/next/dist/next-server/server/render.js:54:854) web: at Function.getInitialProps (/workspace/apps/web/.next/server/pages/_document.js:318:19)
....
web: error Command failed with exit code 1.
web: info Visit https://yarnpkg.com/en/docs/cli/run for documentation about this command.
lerna ERR! yarn run build exited 1 in 'web'
error Command failed with exit code 1.
info Visit https://yarnpkg.com/en/docs/cli/run for documentation about this command.
ERROR: failed to build: exit status 1 ERROR: failed to build: executing lifecycle: failed with status code: 51
## Build Configuration
<!-- Please provide some details about your build configuration. -->
Builder 'paketobuildpacks/builder:full' is trusted Pulling image 'index.docker.io/paketobuildpacks/builder:full' full: Pulling from paketobuildpacks/builder
* What platform (`pack`, `kpack`, `tekton` buildpacks plugin, etc.) are you
using? Please include a version.
pack
* What buildpacks are you using? Please include versions.
paketo-buildpacks/environment-variables 4.1.1
paketo-buildpacks/ca-certificates 3.1.0
paketo-buildpacks/node-engine 0.12.3
paketo-buildpacks/yarn 0.6.1
paketo-buildpacks/yarn-install 0.9.0
paketo-buildpacks/node-module-bom 0.2.4
paketo-buildpacks/node-run-script 0.3.3
paketo-buildpacks/yarn-start 0.8.0
paketo-buildpacks/procfile 5.1.0
* What builder are you using? If custom, can you provide the output from `pack
inspect-builder <builder>`?
* Can you provide a sample app or relevant configuration (`buildpack.yml`,
`nginx.conf`, etc.)?
## Checklist
<!-- Please confirm the following -->
* [x ] I have included log output.
* [ x] The log output includes an error message.
* [ ] I have included steps for reproduction.
Overall I think it is the yarn-install change here
https://github.com/paketo-buildpacks/yarn-install/commit/fe954a28ddf3215d4de85bdf0ce0d845c8535f09
I added the a lock to the older version of nodejs and resolved the issue
[[build.buildpacks]]
id = "paketo-buildpacks/nodejs"
version = "0.16.1"
@HTMachine sorry for the long delay in getting to this issue. Can you provide an update? Are you still experiencing this issue?
I'm going to close this based on the age and that the original poster did not answer @ryanmoran's question.