Closed victorbit closed 6 years ago
Getting same behaviour with http
server, in development, on routes defined in routes.js
.
// server.js
const next = require('next');
const routes = require('./routes');
const app = next({ dir: './app', dev: process.env.NODE_ENV !== 'production' });
const handler = routes.getRequestHandler(app);
const { createServer } = require('http');
app.prepare().then(() => {
createServer(handler).listen(3000);
});
// routes.js
const nextRoutes = require('next-routes');
const routes = module.exports = nextRoutes();
routes
.add('/venue/map', 'map');
Appears to have been resolved for me by stopping the dev server, rebuild and start again.
If it happens again, please try to prepend a slash to the linked path:
<Link to={`/event/1231`} />
Also when adding the route, it should look like this:
routes.add('event', '/event/:slug')
Same here with an express setup. 404 and page refresh in between transitions
@laurenskling Please open a new issue for that with some sample code. Thanks!
I'm using next-routes in a Koa setup. Between route transitions I (shortly) see a 404 page before entering the new route.