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

Infinite ?gatsby-404 and / loop #10166

Closed
narulakeshav opened this issue Nov 27, 2018 · 2 comments
Closed

Infinite ?gatsby-404 and / loop #10166

narulakeshav opened this issue Nov 27, 2018 · 2 comments
Labels
status: awaiting author response Additional information has been requested from the author

Comments

@narulakeshav
Copy link

narulakeshav commented Nov 27, 2018

Description

The index page, / is being re-directed to /?gatsby-404 which is re-directing back to /, creating an infinite loop.

GIF

In the console, I get this error:

Access to link element resource at 'https://narulakeshav.com/static/d/173/path---index-6a9-NZuapzHg3X9TaN1iIixfv1W23E.json' (redirected from 'http://narulakeshav.com/static/d/173/path---index-6a9-NZuapzHg3X9TaN1iIixfv1W23E.json') from origin 'http://narulakeshav.com' has been blocked by CORS policy: The value of the 'Access-Control-Allow-Origin' header in the response must not be the wildcard '*' when the request's credentials mode is 'include'.

Error

I have created a custom 404.js page, which just exports this:

<div style={{ textAlign: 'center', width: '100vw', padding: '10vh 0' }}>
	<h1>Error. Not Found.</h1>
	<p>
	    This page doesn&#39;t exist yet. Probably my cat or something...
	    <br/><br/>
	    <a href="/">Back Home</a>
	</p>
</div>

This doesn't happen when I serve it locally after build gatsby serve, but when I push it to the server, it does this.
EDIT: It works fine on Safari, but not Firefox or Chrome.

Expected result

/ renders and stays on home page.

Actual result

Infinite loop between / and /?gatsby-404.

Environment

System:
OS: macOS High Sierra 10.13.6
CPU: x64 Intel(R) Core(TM) i7-7820HQ CPU @ 2.90GHz
Shell: 5.3 - /bin/zsh
Binaries:
Node: 10.8.0 - /usr/local/bin/node
Yarn: 1.12.1 - ~/.yarn/bin/yarn
npm: 6.4.1 - /usr/local/bin/npm
Browsers:
Chrome: 71.0.3578.62
Safari: 11.1.2
npmGlobalPackages:
gatsby-cli: 2.4.1

@jonniebigodes
Copy link

jonniebigodes commented Nov 29, 2018

@narulakeshav It looks like the issue you're experiencing, might be related to this #10074 . And that one was addressed recently.
So, with that in mind, it would be great if you could update the gatsby library, redeploy your site to the server and make sure that any cache/public/node_modules folders are cleared in order for a fresh version of gatsby is installed and then see if the issue is resolved and report back.
Sounds good?

@jonniebigodes jonniebigodes added the status: awaiting author response Additional information has been requested from the author label Nov 30, 2018
@narulakeshav
Copy link
Author

Thanks @jonniebigodes, this works.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
status: awaiting author response Additional information has been requested from the author
Projects
None yet
Development

No branches or pull requests

2 participants