gatsby: Gatsby Starter Blog v2 Netlify deploy does not work

Description

I am unable to deploy Gatsby Starter Blog v2 on Netlify. I have made no changes to the current code. Please see errors below.

Steps to reproduce

Clone down https://github.com/gatsbyjs/gatsby-starter-blog#v2 Initialize git repo with this code Attempt to deploy via Netlify

Expected result

Site deploys via Netlify

Actual result

Many build errors, primarily around resolving modules. The phrase all errors have in common is Field 'browser' doesn't contain a valid alias configuration. The topmost error is as follows:

4:06:07 PM:   Error: ./.cache/page-renderer.js
4:06:07 PM:   Module not found: Error: Can't resolve '@babel/runtime/helpers/inheritsLoose'   in '/opt/build/repo/.cache'
4:06:07 PM:   resolve '@babel/runtime/helpers/inheritsLoose' in '/opt/build/repo/.cache'
4:06:07 PM:     Parsed request is a module
4:06:07 PM:     using description file: /opt/build/repo/package.json (relative path: ./.cach  e)
4:06:07 PM:       Field 'browser' doesn't contain a valid alias configuration
4:06:07 PM:       resolve as module
4:06:07 PM:         looking for modules in /opt/build/repo/src/node_modules
4:06:07 PM:           using description file: /opt/build/repo/package.json (relative path: .  /src/node_modules)
4:06:07 PM:             Field 'browser' doesn't contain a valid alias configuration
4:06:07 PM:             using description file: /opt/build/repo/package.json (relative path:   ./src/node_modules/@babel/runtime/helpers/inheritsLoose)
4:06:07 PM:               no extension
4:06:07 PM:                 Field 'browser' doesn't contain a valid alias configuration
4:06:07 PM:                 /opt/build/repo/src/node_modules/@babel/runtime/helpers/inherits  Loose doesn't exist
4:06:07 PM:               .js
4:06:07 PM:                 Field 'browser' doesn't contain a valid alias configuration
4:06:07 PM:                 /opt/build/repo/src/node_modules/@babel/runtime/helpers/inherits  Loose.js doesn't exist
4:06:07 PM:               .jsx
4:06:07 PM:                 Field 'browser' doesn't contain a valid alias configuration
4:06:07 PM:                 /opt/build/repo/src/node_modules/@babel/runtime/helpers/inherits  Loose.jsx doesn't exist
4:06:07 PM:               as directory
4:06:07 PM:                 /opt/build/repo/src/node_modules/@babel/runtime/helpers/inherits  Loose doesn't exist
4:06:07 PM:         /opt/build/repo/.cache/node_modules doesn't exist or is not a directory
4:06:07 PM:         /opt/build/node_modules doesn't exist or is not a directory
4:06:07 PM:         /opt/node_modules doesn't exist or is not a directory
4:06:07 PM:         /node_modules doesn't exist or is not a directory
4:06:07 PM:         looking for modules in /opt/build/repo/node_modules
4:06:07 PM:           using description file: /opt/build/repo/package.json (relative path: .  /node_modules)
4:06:07 PM:             Field 'browser' doesn't contain a valid alias configuration
4:06:07 PM:             using description file: /opt/build/repo/package.json (relative path:   ./node_modules/@babel/runtime/helpers/inheritsLoose)
4:06:07 PM:               no extension
4:06:07 PM:                 Field 'browser' doesn't contain a valid alias configuration
4:06:07 PM:                 /opt/build/repo/node_modules/@babel/runtime/helpers/inheritsLoos  e doesn't exist
4:06:07 PM:               .js
4:06:07 PM:                 Field 'browser' doesn't contain a valid alias configuration
4:06:07 PM:                 /opt/build/repo/node_modules/@babel/runtime/helpers/inheritsLoos  e.js doesn't exist
4:06:07 PM:               .jsx
4:06:07 PM:                 Field 'browser' doesn't contain a valid alias configuration
4:06:07 PM:                 /opt/build/repo/node_modules/@babel/runtime/helpers/inheritsLoos  e.jsx doesn't exist
4:06:07 PM:               as directory
4:06:07 PM:                 /opt/build/repo/node_modules/@babel/runtime/helpers/inheritsLoos  e doesn't exist
4:06:07 PM:   [/opt/build/repo/src/node_modules/@babel/runtime/helpers/inheritsLoose]
4:06:07 PM:   [/opt/build/repo/src/node_modules/@babel/runtime/helpers/inheritsLoose.js]
4:06:08 PM:   [/opt/build/repo/src/node_modules/@babel/runtime/helpers/inheritsLoose.jsx]
4:06:08 PM:   [/opt/build/repo/.cache/node_modules]
4:06:08 PM:   [/opt/build/node_modules]
4:06:08 PM:   [/opt/node_modules]
4:06:08 PM:   [/node_modules]
4:06:08 PM:   [/opt/build/repo/node_modules/@babel/runtime/helpers/inheritsLoose]
4:06:08 PM:   [/opt/build/repo/node_modules/@babel/runtime/helpers/inheritsLoose.js]
4:06:08 PM:   [/opt/build/repo/node_modules/@babel/runtime/helpers/inheritsLoose.jsx]
4:06:08 PM:    @ ./.cache/page-renderer.js 2:0-66 16:2-16
4:06:08 PM:    @ ./.cache/production-app.js

I’m happy to share additional errors if that would help.

Environment

System:
    OS: macOS High Sierra 10.13
    CPU: x64 Intel(R) Core(TM) i5-6360U CPU @ 2.00GHz
    Shell: 3.2.57 - /bin/bash
  Binaries:
    Node: 9.4.0 - ~/.nvm/versions/node/v9.4.0/bin/node
    Yarn: 1.7.0 - ~/.yarn/bin/yarn
    npm: 5.6.0 - ~/.nvm/versions/node/v9.4.0/bin/npm
  Browsers:
    Chrome: 67.0.3396.99
    Safari: 11.0
  npmPackages:
    gatsby: next => 2.0.0-beta.61
    gatsby-plugin-feed: next => 2.0.0-beta.4
    gatsby-plugin-google-analytics: next => 2.0.0-beta.3
    gatsby-plugin-offline: next => 2.0.0-beta.5
    gatsby-plugin-react-helmet: next => 3.0.0-beta.4
    gatsby-plugin-sharp: next => 2.0.0-beta.7
    gatsby-plugin-typography: next => 2.2.0-beta.3
    gatsby-remark-copy-linked-files: next => 2.0.0-beta.3
    gatsby-remark-images: next => 2.0.1-beta.9
    gatsby-remark-prismjs: next => 3.0.0-beta.5
    gatsby-remark-responsive-iframe: next => 2.0.0-beta.3
    gatsby-remark-smartypants: next => 2.0.0-beta.3
    gatsby-source-filesystem: next => 2.0.1-beta.10
    gatsby-transformer-remark: next => 2.1.1-beta.5
    gatsby-transformer-sharp: next => 2.1.1-beta.6
  npmGlobalPackages:
    gatsby-cli: 1.1.44

File contents (if changed)

gatsby-config.js: N/A package.json: N/A gatsby-node.js: N/A gatsby-browser.js: N/A gatsby-ssr.js: N/A

About this issue

  • Original URL
  • State: closed
  • Created 6 years ago
  • Comments: 19 (15 by maintainers)

Commits related to this issue

Most upvoted comments

Was able to resolve just now by removing package-lock.json from the repo.

#6834 appears to be broken again (using yarn add instead of npm install --save works).

Ok, I got it to work by using yarn.

  1. Remove package-lock.json
  2. Run yarn locally to create yarn.lock
  3. Set node version in Netlify (with a NODE_VERSION environment variable or in /.nvmrc)

Update: running yarn install fixed this issue for me on Ubuntu.