gatsbyjs / gatsby

The best React-based framework with performance, scalability and security built in.
https://www.gatsbyjs.com
MIT License
55.27k stars 10.32k forks source link

[Gatsby v2] commons.css 404 network error using gatsby develop #5825

Closed thescientist13 closed 6 years ago

thescientist13 commented 6 years ago

Description

I was working my way through the upgrade process to v2 for my website and wanted to report a network request error observed when using gatsby develop. gatsby build does not show this error.

Steps to reproduce

  1. Followed the v2 Upgrade guide
  2. Run gatsby develop and opened the browser
  3. Open the console or network tab screen shot 2018-06-09 at 1 41 28 pm

Expected result

  1. No console errors for a file not related the project

Actual result

  1. A 404 is seen for a file unrelated to the project

Environment

$ ./node_modules/.bin/gatsby info

  System:
    OS: macOS High Sierra 10.13.5
    CPU: x64 Intel(R) Core(TM) i7-6820HQ CPU @ 2.70GHz
    Shell: 3.2.57 - /bin/bash
  Binaries:
    Node: 8.9.4 - /usr/local/bin/node
    Yarn: 1.5.1 - ~/.yarn/bin/yarn
    npm: 5.6.0 - /usr/local/bin/npm
  Browsers:
    Chrome: 67.0.3396.79
    Firefox: 60.0.1
    Safari: 11.1.1
  npmPackages:
    gatsby: next => 2.0.0-alpha.51
    gatsby-cli: ^1.1.58 => 1.1.58
    gatsby-plugin-google-analytics: next => 1.0.20-10
    gatsby-plugin-react-helmet: next => 2.0.12-7
    gatsby-plugin-sitemap: next => 1.2.14-10
    gatsby-plugin-typography: next => 2.0.1-11

File contents (if changed)

gatsby-config.js:

module.exports = {
  siteMetadata: {
    title: 'The Greenhouse I/O',
    siteUrl: 'https://www.thegreenhouse.io',
    description: 'Personal / portfolio website for The Greenhouse.'
  },
  plugins: [
    'gatsby-plugin-typography', 
    'gatsby-plugin-sitemap',
    'gatsby-plugin-react-helmet',
    {
      resolve: 'gatsby-plugin-google-analytics',
      options: {
        trackingId: 'xxx',
        head: true
      }
    }
  ]
};

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

Thoughts

It seems the issue is likely coming from [webpack.config.js]()

Everything works fine for my setup fwiw. Let me know how to help, hopefully this would be a simple fi and I could help out!

Thanks for everything and let me know if you need more info! The upgrade was straightforward for me and everything else is working as expected. 👍

nihgwu commented 6 years ago

actually it comes from here https://github.com/gatsbyjs/gatsby/blob/v2/packages/gatsby/src/cache-dir/develop-static-entry.js#L76

thescientist13 commented 6 years ago

good find @nihgwu !

Happy to make a PR. What do you think the best course of action would be; remove that line? Make it conditional?

pieh commented 6 years ago

@thescientist13 Hah, you might be too late :) @nihgwu already opened PR to fix this - https://github.com/gatsbyjs/gatsby/pull/5837

nihgwu commented 6 years ago

closed via #5837

thescientist13 commented 6 years ago

doh! There goes my chance for some swag! 😆

Nice work @nihgwu !