-
Notifications
You must be signed in to change notification settings - Fork 10.3k
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
TypeError on live reload #28429
Comments
Hey @colebemis ! Thanks for opening this! It is pretty funny actually. You remove gatsby's config.module.rules = [
// Remove the original rule that compiles `.js`. and `.jsx` files...
...config.module.rules.filter(rule => String(rule.test) !== String(/\.jsx?$/)),
// ...and replace it with a custom configuration.
{ I assume when you've added this code it was actually removing the gatsby/packages/gatsby/src/utils/webpack-utils.ts Lines 342 to 349 in bfa7f2d
But we also use the gatsby/packages/gatsby/src/utils/webpack-utils.ts Lines 467 to 470 in bfa7f2d
And some code in gatsby expects Gatsby shouldn't fail in this case, so I've opened a PR that makes it more robust - #28494 But you can also fix it in your code by not removing the |
@vladar Thank you ❤️ That would have taken me forever to figure out myself! |
I'll try out your solution and close this issue if it works 😄 |
Here's a PR with a fix in our repo: primer/react#939 @vladar is this what you had in mind? |
Description
Here's a video demo of this issue: https://www.loom.com/share/64492f6a228446d695ae75c0ed8f92d3?sharedAppSource=personal_library
Live reload is broken when running the docs site locally. Making changes to any markdown file results in this error message in the terminal:
Steps to reproduce
fix-reload-error
branch of https://github.com/primer/componentsyarn
in the root anddocs
directoriesyarn develop
in thedocs
directorydocs/content
directoryExpected result
Making a change to a markdown file should trigger a quick reload of
localhost:8000
with the changes reflected on the page.Actual result
The page doesn't reload and there is an error in the terminal
Environment
Run
gatsby info --clipboard
in your project directory and paste the output here.System:
OS: macOS 10.15.7
CPU: (16) x64 Intel(R) Core(TM) i9-9980HK CPU @ 2.40GHz
Shell: 5.7.1 - /bin/zsh
Binaries:
Node: 12.18.4 - ~/.nvm/versions/node/v12.18.4/bin/node
Yarn: 1.22.4 - /usr/local/bin/yarn
npm: 6.14.6 - ~/.nvm/versions/node/v12.18.4/bin/npm
Languages:
Python: 2.7.16 - /usr/bin/python
Browsers:
Chrome: 86.0.4240.198
Firefox: 81.0.2
Safari: 14.0.1
npmPackages:
gatsby: 2.27.5 => 2.27.5
gatsby-plugin-alias-imports: ^1.0.5 => 1.0.5
Additional context
I ran
git bisect
and it appears the commit that introduced this error was primer/react@f5c831d.My guess is that the relevant change is the Gatsby upgrade in the yarn.lock file:
The text was updated successfully, but these errors were encountered: