title: Gatsby deploy on Netlify failed with Field 'browser' doesn't contain a valid alias configuration
body: <p><strong>Note:</strong> I know there are similar questions with the same error code here on StackOverflow, but their solutions didn't work for me.</p>
  
  <hr>
  
  <p>I'm trying to deploy a Gatsby site on Netlify using GitHub. I followed <a href="https://www.gatsbyjs.org/docs/hosting-on-netlify" rel="nofollow noreferrer">the docs from Gatsby</a>, but my build fails with: </p>
  
  <pre><code>11:06:04 PM:   Error: ./src/pages/index.js
  11:06:04 PM:   Module not found: Error: Can't resolve '../components/Bio' in '/opt/build/repo  /src/pages'
  11:06:04 PM:   resolve '../components/Bio' in '/opt/build/repo/src/pages'
  11:06:04 PM:     using description file: /opt/build/repo/package.json (relative path: ./src/p  ages)
  11:06:04 PM:       Field 'browser' doesn't contain a valid alias configuration
  11:06:04 PM:       using description file: /opt/build/repo/package.json (relative path: ./src  /components/Bio)
  11:06:04 PM:         no extension
  11:06:04 PM:           Field 'browser' doesn't contain a valid alias configuration
  11:06:04 PM:           /opt/build/repo/src/components/Bio doesn't exist
  11:06:04 PM:         .mjs
  11:06:04 PM:           Field 'browser' doesn't contain a valid alias configuration
  11:06:04 PM:           /opt/build/repo/src/components/Bio.mjs doesn't exist
  11:06:04 PM:         .js
  11:06:04 PM:           Field 'browser' doesn't contain a valid alias configuration
  11:06:04 PM:           /opt/build/repo/src/components/Bio.js doesn't exist
  11:06:04 PM:         .jsx
  11:06:04 PM:           Field 'browser' doesn't contain a valid alias configuration
  11:06:04 PM:           /opt/build/repo/src/components/Bio.jsx doesn't exist
  11:06:04 PM:         .wasm
  11:06:04 PM:           Field 'browser' doesn't contain a valid alias configuration
  11:06:04 PM:           /opt/build/repo/src/components/Bio.wasm doesn't exist
  11:06:04 PM:         .json
  11:06:04 PM:           Field 'browser' doesn't contain a valid alias configuration
  11:06:04 PM:           /opt/build/repo/src/components/Bio.json doesn't exist
  11:06:04 PM:         as directory
  11:06:04 PM:           /opt/build/repo/src/components/Bio doesn't exist
  11:06:04 PM:   [/opt/build/repo/src/components/Bio]
  11:06:04 PM:   [/opt/build/repo/src/components/Bio.mjs]
  11:06:04 PM:   [/opt/build/repo/src/components/Bio.js]
  11:06:04 PM:   [/opt/build/repo/src/components/Bio.jsx]
  11:06:04 PM:   [/opt/build/repo/src/components/Bio.wasm]
  11:06:04 PM:   [/opt/build/repo/src/components/Bio.json]
  11:06:04 PM:    @ ./src/pages/index.js 4:0-36 31:63-66
  11:06:04 PM:    @ ./.cache/async-requires.js
  11:06:04 PM:    @ ./.cache/production-app.js
  11:06:04 PM: 
  11:06:04 PM: 
  11:06:04 PM:   Error: ./src/templates/blog-post.js
  11:06:04 PM:   Module not found: Error: Can't resolve '../components/Bio' in '/opt/build/repo  /src/templates'
  11:06:04 PM:   resolve '../components/Bio' in '/opt/build/repo/src/templates'
  11:06:04 PM:     using description file: /opt/build/repo/package.json (relative path: ./src/t  emplates)
  11:06:04 PM:       Field 'browser' doesn't contain a valid alias configuration
  11:06:04 PM:       using description file: /opt/build/repo/package.json (relative path: ./src  /components/Bio)
  11:06:04 PM:         no extension
  11:06:04 PM:           Field 'browser' doesn't contain a valid alias configuration
  11:06:04 PM:           /opt/build/repo/src/components/Bio doesn't exist
  11:06:04 PM:         .mjs
  11:06:04 PM:           Field 'browser' doesn't contain a valid alias configuration
  11:06:04 PM:           /opt/build/repo/src/components/Bio.mjs doesn't exist
  11:06:04 PM:         .js
  11:06:04 PM:           Field 'browser' doesn't contain a valid alias configuration
  11:06:04 PM:           /opt/build/repo/src/components/Bio.js doesn't exist
  11:06:04 PM:         .jsx
  11:06:04 PM:           Field 'browser' doesn't contain a valid alias configuration
  11:06:04 PM:           /opt/build/repo/src/components/Bio.jsx doesn't exist
  11:06:04 PM:         .wasm
  11:06:04 PM:           Field 'browser' doesn't contain a valid alias configuration
  11:06:04 PM:           /opt/build/repo/src/components/Bio.wasm doesn't exist
  11:06:04 PM:         .json
  11:06:04 PM:           Field 'browser' doesn't contain a valid alias configuration
  11:06:04 PM:           /opt/build/repo/src/components/Bio.json doesn't exist
  11:06:04 PM:         as directory
  11:06:04 PM:           /opt/build/repo/src/components/Bio doesn't exist
  11:06:04 PM:   [/opt/build/repo/src/components/Bio]
  11:06:04 PM:   [/opt/build/repo/src/components/Bio.mjs]
  11:06:04 PM:   [/opt/build/repo/src/components/Bio.js]
  11:06:04 PM:   [/opt/build/repo/src/components/Bio.jsx]
  11:06:04 PM:   [/opt/build/repo/src/components/Bio.wasm]
  11:06:04 PM:   [/opt/build/repo/src/components/Bio.json]
  11:06:04 PM:    @ ./src/templates/blog-post.js 5:0-36 65:44-47
  11:06:04 PM:    @ ./.cache/async-requires.js
  11:06:04 PM:    @ ./.cache/production-app.js
  11:06:04 PM: 
  11:06:04 PM: 
  11:06:04 PM:   Error: ./src/pages/index.js
  11:06:04 PM:   Module not found: Error: Can't resolve '../components/Footer' in '/opt/build/r  epo/src/pages'
  11:06:04 PM:   resolve '../components/Footer' in '/opt/build/repo/src/pages'
  11:06:04 PM:     using description file: /opt/build/repo/package.json (relative path: ./src/p  ages)
  11:06:04 PM:       Field 'browser' doesn't contain a valid alias configuration
  11:06:04 PM:       using description file: /opt/build/repo/package.json (relative path: ./src  /components/Footer)
  11:06:04 PM:         no extension
  11:06:04 PM:           Field 'browser' doesn't contain a valid alias configuration
  11:06:04 PM:           /opt/build/repo/src/components/Footer doesn't exist
  11:06:04 PM:         .mjs
  11:06:04 PM:           Field 'browser' doesn't contain a valid alias configuration
  11:06:04 PM:           /opt/build/repo/src/components/Footer.mjs doesn't exist
  11:06:04 PM:         .js
  11:06:04 PM:           Field 'browser' doesn't contain a valid alias configuration
  11:06:04 PM:           /opt/build/repo/src/components/Footer.js doesn't exist
  11:06:04 PM:         .jsx
  11:06:04 PM:           Field 'browser' doesn't contain a valid alias configuration
  11:06:04 PM:           /opt/build/repo/src/components/Footer.jsx doesn't exist
  11:06:04 PM:         .wasm
  11:06:04 PM:           Field 'browser' doesn't contain a valid alias configuration
  11:06:04 PM:           /opt/build/repo/src/components/Footer.wasm doesn't exist
  11:06:04 PM:         .json
  11:06:04 PM:           Field 'browser' doesn't contain a valid alias configuration
  11:06:04 PM:           /opt/build/repo/src/components/Footer.json doesn't exist
  11:06:04 PM:         as directory
  11:06:04 PM:           /opt/build/repo/src/components/Footer doesn't exist
  11:06:04 PM:   [/opt/build/repo/src/components/Footer]
  11:06:04 PM:   [/opt/build/repo/src/components/Footer.mjs]
  11:06:04 PM:   [/opt/build/repo/src/components/Footer.js]
  11:06:04 PM:   [/opt/build/repo/src/components/Footer.jsx]
  11:06:04 PM:   [/opt/build/repo/src/components/Footer.wasm]
  11:06:04 PM:   [/opt/build/repo/src/components/Footer.json]
  11:06:04 PM:    @ ./src/pages/index.js 5:0-42 53:29-35
  11:06:04 PM:    @ ./.cache/async-requires.js
  11:06:04 PM:    @ ./.cache/production-app.js
  11:06:04 PM: 
  11:06:04 PM: 
  11:06:04 PM:   Error: ./src/pages/404.js
  11:06:04 PM:   Module not found: Error: Can't resolve '../components/Layout' in '/opt/build/r  epo/src/pages'
  11:06:04 PM:   resolve '../components/Layout' in '/opt/build/repo/src/pages'
  11:06:04 PM:     using description file: /opt/build/repo/package.json (relative path: ./src/p  ages)
  11:06:04 PM:       Field 'browser' doesn't contain a valid alias configuration
  11:06:04 PM:       using description file: /opt/build/repo/package.json (relative path: ./src  /components/Layout)
  11:06:04 PM:         no extension
  11:06:04 PM:           Field 'browser' doesn't contain a valid alias configuration
  11:06:04 PM:           /opt/build/repo/src/components/Layout doesn't exist
  11:06:04 PM:         .mjs
  11:06:04 PM:           Field 'browser' doesn't contain a valid alias configuration
  11:06:04 PM:           /opt/build/repo/src/components/Layout.mjs doesn't exist
  11:06:04 PM:         .js
  11:06:04 PM:           Field 'browser' doesn't contain a valid alias configuration
  11:06:04 PM:           /opt/build/repo/src/components/Layout.js doesn't exist
  11:06:04 PM:         .jsx
  11:06:04 PM:           Field 'browser' doesn't contain a valid alias configuration
  11:06:04 PM:           /opt/build/repo/src/components/Layout.jsx doesn't exist
  11:06:04 PM:         .wasm
  11:06:04 PM:           Field 'browser' doesn't contain a valid alias configuration
  11:06:04 PM:           /opt/build/repo/src/components/Layout.wasm doesn't exist
  11:06:04 PM:         .json
  11:06:04 PM:           Field 'browser' doesn't contain a valid alias configuration
  11:06:04 PM:           /opt/build/repo/src/components/Layout.json doesn't exist
  11:06:04 PM:         as directory
  11:06:04 PM:           /opt/build/repo/src/components/Layout doesn't exist
  11:06:04 PM:   [/opt/build/repo/src/components/Layout]
  11:06:04 PM:   [/opt/build/repo/src/components/Layout.mjs]
  11:06:04 PM:   [/opt/build/repo/src/components/Layout.js]
  11:06:04 PM:   [/opt/build/repo/src/components/Layout.jsx]
  11:06:04 PM:   [/opt/build/repo/src/components/Layout.wasm]
  11:06:04 PM:   [/opt/build/repo/src/components/Layout.json]
  11:06:04 PM:    @ ./src/pages/404.js 3:0-42 20:31-37
  11:06:04 PM:    @ ./.cache/async-requires.js
  11:06:04 PM:    @ ./.cache/production-app.js
  11:06:04 PM: 
  11:06:04 PM: 
  11:06:04 PM:   Error: ./src/pages/index.js
  11:06:04 PM:   Module not found: Error: Can't resolve '../components/Layout' in '/opt/build/r  epo/src/pages'
  11:06:04 PM:   resolve '../components/Layout' in '/opt/build/repo/src/pages'
  11:06:04 PM:     using description file: /opt/build/repo/package.json (relative path: ./src/p  ages)
  11:06:04 PM:       Field 'browser' doesn't contain a valid alias configuration
  11:06:04 PM:       using description file: /opt/build/repo/package.json (relative path: ./src  /components/Layout)
  11:06:04 PM:         no extension
  11:06:04 PM:           Field 'browser' doesn't contain a valid alias configuration
  11:06:04 PM:           /opt/build/repo/src/components/Layout doesn't exist
  11:06:04 PM:         .mjs
  11:06:04 PM:           Field 'browser' doesn't contain a valid alias configuration
  11:06:04 PM:           /opt/build/repo/src/components/Layout.mjs doesn't exist
  11:06:04 PM:         .js
  11:06:04 PM:           Field 'browser' doesn't contain a valid alias configuration
  11:06:04 PM:           /opt/build/repo/src/components/Layout.js doesn't exist
  11:06:04 PM:         .jsx
  11:06:04 PM:           Field 'browser' doesn't contain a valid alias configuration
  11:06:04 PM:           /opt/build/repo/src/components/Layout.jsx doesn't exist
  11:06:04 PM:         .wasm
  11:06:04 PM:           Field 'browser' doesn't contain a valid alias configuration
  11:06:04 PM:           /opt/build/repo/src/components/Layout.wasm doesn't exist
  11:06:04 PM:         .json
  11:06:04 PM:           Field 'browser' doesn't contain a valid alias configuration
  11:06:04 PM:           /opt/build/repo/src/components/Layout.json doesn't exist
  11:06:04 PM:         as directory
  11:06:04 PM:           /opt/build/repo/src/components/Layout doesn't exist
  11:06:04 PM:   [/opt/build/repo/src/components/Layout]
  11:06:04 PM:   [/opt/build/repo/src/components/Layout.mjs]
  11:06:04 PM:   [/opt/build/repo/src/components/Layout.js]
  11:06:04 PM:   [/opt/build/repo/src/components/Layout.jsx]
  11:06:04 PM:   [/opt/build/repo/src/components/Layout.wasm]
  11:06:04 PM:   [/opt/build/repo/src/components/Layout.json]
  11:06:04 PM:    @ ./src/pages/index.js 6:0-42 26:31-37
  11:06:04 PM:    @ ./.cache/async-requires.js
  11:06:04 PM:    @ ./.cache/production-app.js
  11:06:04 PM: 
  11:06:04 PM: 
  11:06:04 PM:   Error: ./src/templates/blog-post.js
  11:06:04 PM:   Module not found: Error: Can't resolve '../components/Layout' in '/opt/build/r  epo/src/templates'
  11:06:04 PM:   resolve '../components/Layout' in '/opt/build/repo/src/templates'
  11:06:04 PM:     using description file: /opt/build/repo/package.json (relative path: ./src/t  emplates)
  11:06:04 PM:       Field 'browser' doesn't contain a valid alias configuration
  11:06:04 PM:       using description file: /opt/build/repo/package.json (relative path: ./src  /components/Layout)
  11:06:04 PM:         no extension
  11:06:04 PM:           Field 'browser' doesn't contain a valid alias configuration
  11:06:04 PM:           /opt/build/repo/src/components/Layout doesn't exist
  11:06:04 PM:         .mjs
  11:06:04 PM:           Field 'browser' doesn't contain a valid alias configuration
  11:06:04 PM:           /opt/build/repo/src/components/Layout.mjs doesn't exist
  11:06:04 PM:         .js
  11:06:04 PM:           Field 'browser' doesn't contain a valid alias configuration
  11:06:04 PM:           /opt/build/repo/src/components/Layout.js doesn't exist
  11:06:04 PM:         .jsx
  11:06:04 PM:           Field 'browser' doesn't contain a valid alias configuration
  11:06:04 PM:           /opt/build/repo/src/components/Layout.jsx doesn't exist
  11:06:04 PM:         .wasm
  11:06:04 PM:           Field 'browser' doesn't contain a valid alias configuration
  11:06:04 PM:           /opt/build/repo/src/components/Layout.wasm doesn't exist
  11:06:04 PM:         .json
  11:06:04 PM:           Field 'browser' doesn't contain a valid alias configuration
  11:06:04 PM:           /opt/build/repo/src/components/Layout.json doesn't exist
  11:06:04 PM:         as directory
  11:06:04 PM:           /opt/build/repo/src/components/Layout doesn't exist
  11:06:04 PM:   [/opt/build/repo/src/components/Layout]
  11:06:04 PM:   [/opt/build/repo/src/components/Layout.mjs]
  11:06:04 PM:   [/opt/build/repo/src/components/Layout.js]
  11:06:04 PM:   [/opt/build/repo/src/components/Layout.jsx]
  11:06:04 PM:   [/opt/build/repo/src/components/Layout.wasm]
  11:06:04 PM:   [/opt/build/repo/src/components/Layout.json]
  11:06:04 PM:    @ ./src/templates/blog-post.js 6:0-42 31:31-37
  11:06:04 PM:    @ ./.cache/async-requires.js
  11:06:04 PM:    @ ./.cache/production-app.js
  11:06:04 PM: 
  11:06:04 PM: 
  11:06:04 PM:   Error: ./src/pages/404.js
  11:06:04 PM:   Module not found: Error: Can't resolve '../components/Seo' in '/opt/build/repo  /src/pages'
  11:06:04 PM:   resolve '../components/Seo' in '/opt/build/repo/src/pages'
  11:06:04 PM:     using description file: /opt/build/repo/package.json (relative path: ./src/p  ages)
  11:06:04 PM:       Field 'browser' doesn't contain a valid alias configuration
  11:06:04 PM:       using description file: /opt/build/repo/package.json (relative path: ./src  /components/Seo)
  11:06:04 PM:         no extension
  11:06:04 PM:           Field 'browser' doesn't contain a valid alias configuration
  11:06:04 PM:           /opt/build/repo/src/components/Seo doesn't exist
  11:06:04 PM:         .mjs
  11:06:04 PM:           Field 'browser' doesn't contain a valid alias configuration
  11:06:04 PM:           /opt/build/repo/src/components/Seo.mjs doesn't exist
  11:06:04 PM:         .js
  11:06:04 PM:         .js
  11:06:04 PM:         .js
  11:06:04 PM:         .js
  11:06:04 PM:         .js
  11:06:04 PM:           /opt/build/repo/src/components/Seo.jsx doesn't exist
  11:06:04 PM:         .wasm
  11:06:04 PM:           Field 'browser' doesn't contain a valid alias configuration
  11:06:04 PM:           /opt/build/repo/src/components/Seo.wasm doesn't exist
  11:06:04 PM:         .json
  11:06:04 PM:           Field 'browser' doesn't contain a valid alias configuration
  11:06:04 PM:           /opt/build/repo/src/components/Seo.json doesn't exist
  11:06:04 PM:         as directory
  11:06:04 PM:           /opt/build/repo/src/components/Seo doesn't exist
  11:06:04 PM:   [/opt/build/repo/src/components/Seo]
  11:06:04 PM:   [/opt/build/repo/src/components/Seo.mjs]
  11:06:04 PM:   [/opt/build/repo/src/components/Seo.js]
  11:06:04 PM:   [/opt/build/repo/src/components/Seo.jsx]
  11:06:04 PM:   [/opt/build/repo/src/components/Seo.wasm]
  11:06:04 PM:   [/opt/build/repo/src/components/Seo.json]
  11:06:04 PM:    @ ./src/pages/404.js 4:0-36 23:27-30
  11:06:04 PM:    @ ./.cache/async-requires.js
  11:06:04 PM:    @ ./.cache/production-app.js
  11:06:04 PM: 
  11:06:04 PM: 
  11:06:04 PM:   Error: ./src/pages/index.js
  11:06:04 PM:   Module not found: Error: Can't resolve '../components/Seo' in '/opt/build/repo  /src/pages'
  11:06:04 PM:   resolve '../components/Seo' in '/opt/build/repo/src/pages'
  11:06:04 PM:     using description file: /opt/build/repo/package.json (relative path: ./src/p  ages)
  11:06:04 PM:       Field 'browser' doesn't contain a valid alias configuration
  11:06:04 PM:       using description file: /opt/build/repo/package.json (relative path: ./src  /components/Seo)
  11:06:04 PM:         no extension
  11:06:04 PM:           Field 'browser' doesn't contain a valid alias configuration
  11:06:04 PM:           /opt/build/repo/src/components/Seo doesn't exist
  11:06:04 PM:         .mjs
  11:06:04 PM:           Field 'browser' doesn't contain a valid alias configuration
  11:06:04 PM:           /opt/build/repo/src/components/Seo.mjs doesn't exist
  11:06:09 PM: failed during stage 'building site': Build script returned non-zero exit code: 1
  11:06:09 PM: failed during stage 'building site': Build script returned non-zero exit code: 1
  11:06:09 PM: failed during stage 'building site': Build script returned non-zero exit code: 1
  11:06:09 PM: failed during stage 'building site': Build script returned non-zero exit code: 1
  11:06:09 PM: Shutting down logging, 115 messages pending
  </code></pre>
  
  <p>When I google this error message, the solutions seems to be to make sure that the imports are all properly cased. And I checked that and my imports are all properly uppercased:</p>
  
  <p><a href="https://i.stack.imgur.com/DoGen.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/DoGen.png" alt="My components and the import in one file"></a></p>
  
  <p>And here is a search for the imports:</p>
  
  <p><a href="https://i.stack.imgur.com/UJbQ5.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/UJbQ5.png" alt="enter image description here"></a></p>
  
  <p>As you can see, they are all properly cased. What could be the error?</p>
  
  <p>I'm building with <code>yarn</code> if that matters and my build command is <code>gatsby build</code>.</p>