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

Error handling routes containing . #493

Closed
cheapsteak opened this issue Aug 25, 2016 · 4 comments
Closed

Error handling routes containing . #493

cheapsteak opened this issue Aug 25, 2016 · 4 comments

Comments

@cheapsteak
Copy link

cheapsteak commented Aug 25, 2016

Problem

Accessing route /releases/1.3.4 is treaded as a request for a file and the page fails to load with the error Cannot GET /releases/1.3.4

Partial project-specific fix:

modifying scripts/start.js:

historyApiFallback: {
  rewrites: [
    {
      from: /^\/releases\/.*$/,
      to: '/'
    }
  ]
},

Problem with partial fix

Probably undesirable to rewrite absolutely everything with a . to /, since we do sometimes want to request files

Since config files are undesirable, not sure how best to solve this

@gaearon
Copy link
Contributor

gaearon commented Aug 25, 2016

Which version of react-scripts is in your package.json?

@cheapsteak
Copy link
Author

Apologies, how can I check that?
The project was created and ejected from create-react-app version: 0.2.0, I can't find a react-scripts in the package.json of either the ejected project or in my nvm's node_module's create-react-app folder

@cheapsteak
Copy link
Author

ack-ing through my folders I see caches for react-scripts 0.2.1

Apologies again, I see that the issue has been resolved in 0.2.3

Closing ticket

@gaearon
Copy link
Contributor

gaearon commented Aug 25, 2016

Sorry, after ejecting you can’t get the updates to react-scripts.
The issue has been fixed in react-scripts@0.2.3 but you can apply a similar fix to your ejected project.

It was fixed in #422 which itself depends on #282 so you’d probably want to apply both.

@lock lock bot locked and limited conversation to collaborators Jan 22, 2019
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants