Comments (11)
match({ routes, location: req.url }, (error, redirectLocation, renderProps) => {
if (error) {
console.log('Error', error);
res.status(500).send(error);
} else if (redirectLocation) {
res.redirect(302, redirectLocation.pathname + redirectLocation.search);
} else if (renderProps) {
const devTools = (isDev) ? <DevTools /> : null;
const html = renderToString(
<RouterContext {...renderProps} />
);
res.render('index', { isProd: (!isDev), html: html });
} else {
res.status(404).send('Not Found');
}
});
@GordyD It looks like it is just an issue of keeping up with react-router's fast moving changes. This is a bit more idiomatic.
from 3ree.
@GordyD If I removed {devTools} in app.js or rather set it to null ... the error goes away. Is this normal behavior on initial loading, etc.?
from 3ree.
I get this error when i make requests to port 3000, but not 3001. The docs say to use :3001 for the dev server.
from 3ree.
Can you log the the req.url
that this error was triggered on? This should help track what the issue is.
from 3ree.
@GordyD --- > @robotate is correct, I have localhost:3000 in cache, so that it before I could hit :3001 ... and if I do port 3001, no error, but port :3000 the app sort of shows and just throws that error in the console. So with that, I will close this as it was not an issue with the code itself; user, or cache, error.
from 3ree.
How to fix it?
I think it's not cache error. RouterContext should have history prop. But history prop is just
{ }
from 3ree.
@endigo What I meant by cache, you know how when typing a URL I typed localhost:3 and hit tab and :3000 was in the URL cache so I saw the error. if I explicitly type localhost:3001 I didn't see the error. Are you seeing the error even when only hitting localhost:3001?
from 3ree.
@tzarger No error occurs on port 3001. Only on port 3000. I was use firefox, chrome, chrome incognito mode, it's occurs same error
from 3ree.
Yeah I get the same when hitting http://localhost:3001, and it seems benign. It seems to happen when first loading the site in the browser after an npm start. I cleared my cache in Chrome but it still happens. I'll try to nail it down and provide more info.
from 3ree.
Thanks for looking into this. If I get time to look over the weekend I'll try to investigate too.
from 3ree.
@ryanyogan is correct.the 'renderProp' is not always has value.when it doesn't, the error reappears.
from 3ree.
Related Issues (20)
- Is Jade Necessary? HOT 4
- Sorry there is no Error
- Required prop `location` HOT 1
- Add Unit Tests HOT 1
- Add ESlint HOT 4
- not updating between multiple browsers HOT 1
- Upgrade to Babel 6 HOT 3
- Having a grandparent directory named 'src' causes bug HOT 2
- Move to react-router-redux HOT 10
- NOT an Issue - More a Question - Account Integration HOT 7
- rethinkdb not installed as global
- Misc HOT 3
- Unhandled rejection TypeError when loading page HOT 11
- Error running project on Windows HOT 3
- Slow loading on demo app HOT 3
- Warning: React attempted to reuse markup in a container but the checksum was invalid HOT 3
- Any plans to add auth? HOT 4
- Why not add PostCSS and Autoprefixer?
- Can't Install on Ubuntu 16.04.1 HOT 4
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from 3ree.