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

Building JS and and CSS fails during deployment #25257

Closed
EliranGooner opened this issue Jun 24, 2020 · 2 comments
Closed

Building JS and and CSS fails during deployment #25257

EliranGooner opened this issue Jun 24, 2020 · 2 comments
Assignees
Labels
topic: webpack/babel Webpack or babel type: bug An issue or pull request relating to a bug in Gatsby

Comments

@EliranGooner
Copy link

Description

When I try to deploy my gatsby project to heroku after I didn't touch for a while, the deployment just keeps failing. It gets to building the JS and CSS but then runs into a bunch of errors. When I run gatsby build it finishes successfully.

Steps to reproduce

Run git push heroku master on the repo.

Expected result

JS and CSS building successfully.

Actual result

I'm getting this error:

remote:        failed Building production JavaScript and CSS bundles - 2.048s
remote: error Generating JavaScript bundles failed
remote: 
remote: [BABEL] /tmp/build_94433f4f74941a672629446cec5e493e/.cache/production-app.js: Cannot find module '@babel/compat-data/corejs3-shipped-proposals'
remote: Require stack:
remote: - /tmp/build_94433f4f74941a672629446cec5e493e/node_modules/@babel/preset-env/lib/polyfills/corejs3/usage-plugin.js
remote: - /tmp/build_94433f4f74941a672629446cec5e493e/node_modules/@babel/preset-env/lib/index.js
remote: - /tmp/build_94433f4f74941a672629446cec5e493e/node_modules/@babel/core/lib/config/files/plugins.js
remote: - /tmp/build_94433f4f74941a672629446cec5e493e/node_modules/@babel/core/lib/config/files/index.js
remote: - /tmp/build_94433f4f74941a672629446cec5e493e/node_modules/@babel/core/lib/index.js
remote: - /tmp/build_94433f4f74941a672629446cec5e493e/node_modules/babel-loader/lib/index.js
remote: - /tmp/build_94433f4f74941a672629446cec5e493e/node_modules/gatsby/dist/utils/babel-loader.js
remote: - /tmp/build_94433f4f74941a672629446cec5e493e/node_modules/loader-runner/lib/loadLoader.js
remote: - /tmp/build_94433f4f74941a672629446cec5e493e/node_modules/loader-runner/lib/LoaderRunner.js
remote: - /tmp/build_94433f4f74941a672629446cec5e493e/node_modules/webpack/lib/NormalModule.js
remote: - /tmp/build_94433f4f74941a672629446cec5e493e/node_modules/webpack/lib/NormalModuleFactory.js
remote: - /tmp/build_94433f4f74941a672629446cec5e493e/node_modules/webpack/lib/Compiler.js
remote: - /tmp/build_94433f4f74941a672629446cec5e493e/node_modules/webpack/lib/webpack.js
remote: - /tmp/build_94433f4f74941a672629446cec5e493e/node_modules/gatsby/dist/commands/build-html.js
remote: - /tmp/build_94433f4f74941a672629446cec5e493e/node_modules/gatsby/dist/commands/build.js
remote: - /tmp/build_94433f4f74941a672629446cec5e493e/node_modules/gatsby/node_modules/gatsby-cli/lib/create-cli.js
remote: - /tmp/build_94433f4f74941a672629446cec5e493e/node_modules/gatsby/node_modules/gatsby-cli/lib/index.js
remote: - /tmp/build_94433f4f74941a672629446cec5e493e/node_modules/gatsby/dist/bin/gatsby.js
remote:        not finished run queries - 8.739s
remote:        not finished Generating image thumbnails - 8.691s
remote: 
remote: (sharp:10805): GLib-CRITICAL **: 13:28:07.415: g_hash_table_lookup: assertion 'hash_table != NULL' failed
remote: 
remote: (sharp:10805): GLib-CRITICAL **: 13:28:07.416: g_hash_table_lookup: assertion 'hash_table != NULL' failed
remote: 
remote: (sharp:10805): GLib-CRITICAL **: 13:28:07.589: g_hash_table_lookup: assertion 'hash_table != NULL' failed
remote: npm ERR! code ELIFECYCLE
remote: npm ERR! errno 1
remote: npm ERR! gatsby-starter-default@0.1.0 build: `gatsby build`
remote: npm ERR! Exit status 1
remote: npm ERR! 
remote: npm ERR! Failed at the gatsby-starter-default@0.1.0 build script.
remote: npm ERR! This is probably not a problem with npm. There is likely additional logging output above.

Environment

System:
OS: macOS 10.15.4
CPU: (8) x64 Intel(R) Core(TM) i5-8279U CPU @ 2.40GHz
Shell: 5.7.1 - /bin/zsh
Binaries:
Node: 13.12.0 - ~/.nvm/versions/node/v13.12.0/bin/node
Yarn: 1.22.4 - /usr/local/bin/yarn
npm: 6.14.4 - ~/.nvm/versions/node/v13.12.0/bin/npm
Languages:
Python: 2.7.16 - /usr/bin/python
Browsers:
Chrome: 83.0.4103.106
Safari: 13.1
npmPackages:
gatsby: ^2.19.7 => 2.19.41
gatsby-background-image: ^0.10.2 => 0.10.2
gatsby-cli: ^2.10.9 => 2.11.1
gatsby-image: ^2.2.39 => 2.2.43
gatsby-plugin-env-variables: ^1.0.1 => 1.0.1
gatsby-plugin-google-analytics: ^2.2.2 => 2.2.2
gatsby-plugin-google-fonts: ^1.0.1 => 1.0.1
gatsby-plugin-manifest: ^2.2.39 => 2.2.47
gatsby-plugin-offline: ^3.0.32 => 3.0.40
gatsby-plugin-prefetch-google-fonts: ^1.4.3 => 1.4.3
gatsby-plugin-react-helmet: ^3.1.21 => 3.1.23
gatsby-plugin-robots-txt: ^1.5.0 => 1.5.0
gatsby-plugin-sass: ^2.1.30 => 2.1.30
gatsby-plugin-sharp: ^2.4.3 => 2.4.12
gatsby-plugin-sitemap: ^2.3.1 => 2.3.1
gatsby-plugin-transition-link: ^1.18.0 => 1.18.0
gatsby-source-filesystem: ^2.1.46 => 2.1.54
gatsby-transformer-sharp: ^2.3.13 => 2.3.18

@EliranGooner EliranGooner added the type: bug An issue or pull request relating to a bug in Gatsby label Jun 24, 2020
@gatsbot gatsbot bot added the status: triage needed Issue or pull request that need to be triaged and assigned to a reviewer label Jun 24, 2020
@pieh
Copy link
Contributor

pieh commented Jun 25, 2020

Can you try re-generating npm/yarn lock file? For a test just deleting lock file (and maybe node_modules as well for a good measure) and installing deps again and trying to push that to heroku.

This issue doesn't seem gatsby specific given I found similar in other projects:

In particular nodejs/node#32852 / babel/babel#11283 is interesting as it seems that some babel packages prior to 7.9.0 were not working correctly in some node version (>13.13, >12.17) so if heroku is using node version that is affected that could be the reason. Gatsby already upgraded to babel package with fixed, but if you use 2.19.41 (from your info command) you might need to update gatsby (or just those deps, via lock file)

@pieh pieh removed the status: triage needed Issue or pull request that need to be triaged and assigned to a reviewer label Jun 25, 2020
@pieh pieh self-assigned this Jun 25, 2020
@pieh pieh added the topic: webpack/babel Webpack or babel label Jun 25, 2020
@EliranGooner
Copy link
Author

EliranGooner commented Jun 25, 2020

Can you try re-generating npm/yarn lock file? For a test just deleting lock file (and maybe node_modules as well for a good measure) and installing deps again and trying to push that to heroku.

This issue doesn't seem gatsby specific given I found similar in other projects:

In particular nodejs/node#32852 / babel/babel#11283 is interesting as it seems that some babel packages prior to 7.9.0 were not working correctly in some node version (>13.13, >12.17) so if heroku is using node version that is affected that could be the reason. Gatsby already upgraded to babel package with fixed, but if you use 2.19.41 (from your info command) you might need to update gatsby (or just those deps, via lock file)

I re-generated the lock file and now passes this hurdle but I came across another one.
The issue came up in regards to an window is not defined error from build files (I think). Opened another github issue: #25298

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
topic: webpack/babel Webpack or babel type: bug An issue or pull request relating to a bug in Gatsby
Projects
None yet
Development

No branches or pull requests

2 participants