NextJS- How handle redirect, meanwhile my strategy returns an error
I'm trying to fetch the URL entered in the browser to make some redirect in my NextJS custom server. This error occurs only in dev mode, no in production mode, so is it normal ? there is some modification to do on the devmode to handle that ?
I have tried to use the pathname object. Sadly when I first entered an URL in my address bar, my pathname firstly returns:
/_next/static/chunks/0.js
I have tried with req.rawHeaders. But my console returns nothing till the 15th trial:
req.rawHeaders path in next.server.js :
req.rawHeaders path in next.server.js :
req.rawHeaders path in next.server.js :
req.rawHeaders path in next.server.js :
req.rawHeaders path in next.server.js :
req.rawHeaders path in next.server.js :
req.rawHeaders path in next.server.js :
req.rawHeaders path in next.server.js :
req.rawHeaders path in next.server.js :
req.rawHeaders path in next.server.js :
req.rawHeaders path in next.server.js :
req.rawHeaders path in next.server.js :
req.rawHeaders path in next.server.js :
req.rawHeaders path in next.server.js :
req.rawHeaders path in next.server.js :
req.rawHeaders path in next.server.js : /pathTargeted // work ! but a little bit in late ..
I have also tried with req.headers.referer but even, the first path returns is not the path I have entered in the URL.
The result is that I fall in a 404 error. So how avoid this and always fetch the real address entered in the browser ? That exactly my problem.
Here my reactjs snippet:
import React, {Component} from "react";
import style from "./BlogHubTemplate.module.css";
import storeWrapper from "../../HOC/storeWrapper/storeWrapper"
import {connect} from 'react-redux';
import Router from 'next/router'
class BlogHubTemplate extends Component {
redirectPost = (postCategory, postTitle) => {
Router.replace(`/${postCategory}/${postTitle}`)
}
here my custom next.server js:
app.prepare().then(() => {
createServer((req, res) => {
// Be sure to pass `true` as the second argument to `url.parse`.
// This tells it to parse the query portion of the URL.
const parsedUrl = parse(req.url, true)
const { pathname, query } = parsedUrl;
console.log("req.headers in next.server.js : ", req.headers.referer.substr(22))
console.log("req.rawHeaders path in next.server.js : ", req.rawHeaders[11].substr(22))
Any hint would be great,
thanks
reactjs next
add a comment |
I'm trying to fetch the URL entered in the browser to make some redirect in my NextJS custom server. This error occurs only in dev mode, no in production mode, so is it normal ? there is some modification to do on the devmode to handle that ?
I have tried to use the pathname object. Sadly when I first entered an URL in my address bar, my pathname firstly returns:
/_next/static/chunks/0.js
I have tried with req.rawHeaders. But my console returns nothing till the 15th trial:
req.rawHeaders path in next.server.js :
req.rawHeaders path in next.server.js :
req.rawHeaders path in next.server.js :
req.rawHeaders path in next.server.js :
req.rawHeaders path in next.server.js :
req.rawHeaders path in next.server.js :
req.rawHeaders path in next.server.js :
req.rawHeaders path in next.server.js :
req.rawHeaders path in next.server.js :
req.rawHeaders path in next.server.js :
req.rawHeaders path in next.server.js :
req.rawHeaders path in next.server.js :
req.rawHeaders path in next.server.js :
req.rawHeaders path in next.server.js :
req.rawHeaders path in next.server.js :
req.rawHeaders path in next.server.js : /pathTargeted // work ! but a little bit in late ..
I have also tried with req.headers.referer but even, the first path returns is not the path I have entered in the URL.
The result is that I fall in a 404 error. So how avoid this and always fetch the real address entered in the browser ? That exactly my problem.
Here my reactjs snippet:
import React, {Component} from "react";
import style from "./BlogHubTemplate.module.css";
import storeWrapper from "../../HOC/storeWrapper/storeWrapper"
import {connect} from 'react-redux';
import Router from 'next/router'
class BlogHubTemplate extends Component {
redirectPost = (postCategory, postTitle) => {
Router.replace(`/${postCategory}/${postTitle}`)
}
here my custom next.server js:
app.prepare().then(() => {
createServer((req, res) => {
// Be sure to pass `true` as the second argument to `url.parse`.
// This tells it to parse the query portion of the URL.
const parsedUrl = parse(req.url, true)
const { pathname, query } = parsedUrl;
console.log("req.headers in next.server.js : ", req.headers.referer.substr(22))
console.log("req.rawHeaders path in next.server.js : ", req.rawHeaders[11].substr(22))
Any hint would be great,
thanks
reactjs next
If you have a repo with the minimum reproducible setup that would be awesome.
– Divyanshu Maithani
Nov 15 '18 at 17:22
here the repo: github.com/Hocoh/redirect_next . It should specifically reproduce the case and when you will try to go on the blog post's page, you'll firstly have a 404 error, come back to me if you have any question, you can launch the repo with "yarn dev" command, thanks
– HoCo_
Nov 17 '18 at 14:56
@HoCo_ you can add me as contributor to your repo, and I will window.location in all files, my github: odykyi
– аlex dykyі
Nov 21 '18 at 22:04
add a comment |
I'm trying to fetch the URL entered in the browser to make some redirect in my NextJS custom server. This error occurs only in dev mode, no in production mode, so is it normal ? there is some modification to do on the devmode to handle that ?
I have tried to use the pathname object. Sadly when I first entered an URL in my address bar, my pathname firstly returns:
/_next/static/chunks/0.js
I have tried with req.rawHeaders. But my console returns nothing till the 15th trial:
req.rawHeaders path in next.server.js :
req.rawHeaders path in next.server.js :
req.rawHeaders path in next.server.js :
req.rawHeaders path in next.server.js :
req.rawHeaders path in next.server.js :
req.rawHeaders path in next.server.js :
req.rawHeaders path in next.server.js :
req.rawHeaders path in next.server.js :
req.rawHeaders path in next.server.js :
req.rawHeaders path in next.server.js :
req.rawHeaders path in next.server.js :
req.rawHeaders path in next.server.js :
req.rawHeaders path in next.server.js :
req.rawHeaders path in next.server.js :
req.rawHeaders path in next.server.js :
req.rawHeaders path in next.server.js : /pathTargeted // work ! but a little bit in late ..
I have also tried with req.headers.referer but even, the first path returns is not the path I have entered in the URL.
The result is that I fall in a 404 error. So how avoid this and always fetch the real address entered in the browser ? That exactly my problem.
Here my reactjs snippet:
import React, {Component} from "react";
import style from "./BlogHubTemplate.module.css";
import storeWrapper from "../../HOC/storeWrapper/storeWrapper"
import {connect} from 'react-redux';
import Router from 'next/router'
class BlogHubTemplate extends Component {
redirectPost = (postCategory, postTitle) => {
Router.replace(`/${postCategory}/${postTitle}`)
}
here my custom next.server js:
app.prepare().then(() => {
createServer((req, res) => {
// Be sure to pass `true` as the second argument to `url.parse`.
// This tells it to parse the query portion of the URL.
const parsedUrl = parse(req.url, true)
const { pathname, query } = parsedUrl;
console.log("req.headers in next.server.js : ", req.headers.referer.substr(22))
console.log("req.rawHeaders path in next.server.js : ", req.rawHeaders[11].substr(22))
Any hint would be great,
thanks
reactjs next
I'm trying to fetch the URL entered in the browser to make some redirect in my NextJS custom server. This error occurs only in dev mode, no in production mode, so is it normal ? there is some modification to do on the devmode to handle that ?
I have tried to use the pathname object. Sadly when I first entered an URL in my address bar, my pathname firstly returns:
/_next/static/chunks/0.js
I have tried with req.rawHeaders. But my console returns nothing till the 15th trial:
req.rawHeaders path in next.server.js :
req.rawHeaders path in next.server.js :
req.rawHeaders path in next.server.js :
req.rawHeaders path in next.server.js :
req.rawHeaders path in next.server.js :
req.rawHeaders path in next.server.js :
req.rawHeaders path in next.server.js :
req.rawHeaders path in next.server.js :
req.rawHeaders path in next.server.js :
req.rawHeaders path in next.server.js :
req.rawHeaders path in next.server.js :
req.rawHeaders path in next.server.js :
req.rawHeaders path in next.server.js :
req.rawHeaders path in next.server.js :
req.rawHeaders path in next.server.js :
req.rawHeaders path in next.server.js : /pathTargeted // work ! but a little bit in late ..
I have also tried with req.headers.referer but even, the first path returns is not the path I have entered in the URL.
The result is that I fall in a 404 error. So how avoid this and always fetch the real address entered in the browser ? That exactly my problem.
Here my reactjs snippet:
import React, {Component} from "react";
import style from "./BlogHubTemplate.module.css";
import storeWrapper from "../../HOC/storeWrapper/storeWrapper"
import {connect} from 'react-redux';
import Router from 'next/router'
class BlogHubTemplate extends Component {
redirectPost = (postCategory, postTitle) => {
Router.replace(`/${postCategory}/${postTitle}`)
}
here my custom next.server js:
app.prepare().then(() => {
createServer((req, res) => {
// Be sure to pass `true` as the second argument to `url.parse`.
// This tells it to parse the query portion of the URL.
const parsedUrl = parse(req.url, true)
const { pathname, query } = parsedUrl;
console.log("req.headers in next.server.js : ", req.headers.referer.substr(22))
console.log("req.rawHeaders path in next.server.js : ", req.rawHeaders[11].substr(22))
Any hint would be great,
thanks
reactjs next
reactjs next
edited Oct 18 '18 at 10:06
HoCo_
asked Oct 9 '18 at 11:29
HoCo_HoCo_
126216
126216
If you have a repo with the minimum reproducible setup that would be awesome.
– Divyanshu Maithani
Nov 15 '18 at 17:22
here the repo: github.com/Hocoh/redirect_next . It should specifically reproduce the case and when you will try to go on the blog post's page, you'll firstly have a 404 error, come back to me if you have any question, you can launch the repo with "yarn dev" command, thanks
– HoCo_
Nov 17 '18 at 14:56
@HoCo_ you can add me as contributor to your repo, and I will window.location in all files, my github: odykyi
– аlex dykyі
Nov 21 '18 at 22:04
add a comment |
If you have a repo with the minimum reproducible setup that would be awesome.
– Divyanshu Maithani
Nov 15 '18 at 17:22
here the repo: github.com/Hocoh/redirect_next . It should specifically reproduce the case and when you will try to go on the blog post's page, you'll firstly have a 404 error, come back to me if you have any question, you can launch the repo with "yarn dev" command, thanks
– HoCo_
Nov 17 '18 at 14:56
@HoCo_ you can add me as contributor to your repo, and I will window.location in all files, my github: odykyi
– аlex dykyі
Nov 21 '18 at 22:04
If you have a repo with the minimum reproducible setup that would be awesome.
– Divyanshu Maithani
Nov 15 '18 at 17:22
If you have a repo with the minimum reproducible setup that would be awesome.
– Divyanshu Maithani
Nov 15 '18 at 17:22
here the repo: github.com/Hocoh/redirect_next . It should specifically reproduce the case and when you will try to go on the blog post's page, you'll firstly have a 404 error, come back to me if you have any question, you can launch the repo with "yarn dev" command, thanks
– HoCo_
Nov 17 '18 at 14:56
here the repo: github.com/Hocoh/redirect_next . It should specifically reproduce the case and when you will try to go on the blog post's page, you'll firstly have a 404 error, come back to me if you have any question, you can launch the repo with "yarn dev" command, thanks
– HoCo_
Nov 17 '18 at 14:56
@HoCo_ you can add me as contributor to your repo, and I will window.location in all files, my github: odykyi
– аlex dykyі
Nov 21 '18 at 22:04
@HoCo_ you can add me as contributor to your repo, and I will window.location in all files, my github: odykyi
– аlex dykyі
Nov 21 '18 at 22:04
add a comment |
1 Answer
1
active
oldest
votes
This is not a next.js issue
just add decodeURIComponent
in every place where you use window.location.pathname
28 code line https://github.com/Hocoh/redirect_next/blob/master/ui/pages/post.js#L29
instead of:
var postFullPath = window.location.pathname.substr(1) ;
shuld be:
var postFullPath = decodeURIComponent(window.location.pathname).substr(1) ;
38 code line https://github.com/Hocoh/redirect_next/blob/master/ui/pages/blog.js#L38
instead of:
var pageTargeted = window.location.pathname.substr(11) ;
shuld be:
var pageTargeted = decodeURIComponent(window.location.pathname).substr(11) ;
13 code line
https://github.com/Hocoh/redirect_next/blob/master/ui/components/BlogHubTemplate/utils/Pagination/Pagination.js#L13
instead of
window.location.pathname = `blog/page/${pageTargeted}`
shoud be:
Router.push(decodeURIComponent(`blog/page/${pageTargeted}`))
10 code line
https://github.com/Hocoh/redirect_next/blob/master/ui/components/BlogHubTemplate/utils/Pagination/PaginationMain/PaginationMain.js#L10
instead of:
window.location.pathname = `blog/page/${pageTargeted}`
should be:
Router.push(decodeURIComponent(`blog/page/${pageTargeted}`))
code line 31
https://github.com/Hocoh/redirect_next/blob/master/ui/components/BlogHubTemplate/BlogHubTemplate.js#L31
instead of:
Router.replace(`/${postCategory}/${postTitle}`);
should be:
Router.push(decodeURIComponent(`/${postCategory}/${postTitle}`));
and add decodeURIComponent
to another files
@HoCo_ github.com/Hocoh/redirect_next/pull/1
– аlex dykyі
Nov 21 '18 at 23:33
@HoCo_ pls define here your routes github.com/Hocoh/redirect_next/blob/master/ui/routes.js , you can just write in comments your routes, and I will it rewrite it to nextjs routes
– аlex dykyі
Nov 22 '18 at 11:04
add a comment |
Your Answer
StackExchange.ifUsing("editor", function () {
StackExchange.using("externalEditor", function () {
StackExchange.using("snippets", function () {
StackExchange.snippets.init();
});
});
}, "code-snippets");
StackExchange.ready(function() {
var channelOptions = {
tags: "".split(" "),
id: "1"
};
initTagRenderer("".split(" "), "".split(" "), channelOptions);
StackExchange.using("externalEditor", function() {
// Have to fire editor after snippets, if snippets enabled
if (StackExchange.settings.snippets.snippetsEnabled) {
StackExchange.using("snippets", function() {
createEditor();
});
}
else {
createEditor();
}
});
function createEditor() {
StackExchange.prepareEditor({
heartbeatType: 'answer',
autoActivateHeartbeat: false,
convertImagesToLinks: true,
noModals: true,
showLowRepImageUploadWarning: true,
reputationToPostImages: 10,
bindNavPrevention: true,
postfix: "",
imageUploader: {
brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
allowUrls: true
},
onDemand: true,
discardSelector: ".discard-answer"
,immediatelyShowMarkdownHelp:true
});
}
});
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
StackExchange.ready(
function () {
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f52719993%2fnextjs-how-handle-redirect-meanwhile-my-strategy-returns-an-error%23new-answer', 'question_page');
}
);
Post as a guest
Required, but never shown
1 Answer
1
active
oldest
votes
1 Answer
1
active
oldest
votes
active
oldest
votes
active
oldest
votes
This is not a next.js issue
just add decodeURIComponent
in every place where you use window.location.pathname
28 code line https://github.com/Hocoh/redirect_next/blob/master/ui/pages/post.js#L29
instead of:
var postFullPath = window.location.pathname.substr(1) ;
shuld be:
var postFullPath = decodeURIComponent(window.location.pathname).substr(1) ;
38 code line https://github.com/Hocoh/redirect_next/blob/master/ui/pages/blog.js#L38
instead of:
var pageTargeted = window.location.pathname.substr(11) ;
shuld be:
var pageTargeted = decodeURIComponent(window.location.pathname).substr(11) ;
13 code line
https://github.com/Hocoh/redirect_next/blob/master/ui/components/BlogHubTemplate/utils/Pagination/Pagination.js#L13
instead of
window.location.pathname = `blog/page/${pageTargeted}`
shoud be:
Router.push(decodeURIComponent(`blog/page/${pageTargeted}`))
10 code line
https://github.com/Hocoh/redirect_next/blob/master/ui/components/BlogHubTemplate/utils/Pagination/PaginationMain/PaginationMain.js#L10
instead of:
window.location.pathname = `blog/page/${pageTargeted}`
should be:
Router.push(decodeURIComponent(`blog/page/${pageTargeted}`))
code line 31
https://github.com/Hocoh/redirect_next/blob/master/ui/components/BlogHubTemplate/BlogHubTemplate.js#L31
instead of:
Router.replace(`/${postCategory}/${postTitle}`);
should be:
Router.push(decodeURIComponent(`/${postCategory}/${postTitle}`));
and add decodeURIComponent
to another files
@HoCo_ github.com/Hocoh/redirect_next/pull/1
– аlex dykyі
Nov 21 '18 at 23:33
@HoCo_ pls define here your routes github.com/Hocoh/redirect_next/blob/master/ui/routes.js , you can just write in comments your routes, and I will it rewrite it to nextjs routes
– аlex dykyі
Nov 22 '18 at 11:04
add a comment |
This is not a next.js issue
just add decodeURIComponent
in every place where you use window.location.pathname
28 code line https://github.com/Hocoh/redirect_next/blob/master/ui/pages/post.js#L29
instead of:
var postFullPath = window.location.pathname.substr(1) ;
shuld be:
var postFullPath = decodeURIComponent(window.location.pathname).substr(1) ;
38 code line https://github.com/Hocoh/redirect_next/blob/master/ui/pages/blog.js#L38
instead of:
var pageTargeted = window.location.pathname.substr(11) ;
shuld be:
var pageTargeted = decodeURIComponent(window.location.pathname).substr(11) ;
13 code line
https://github.com/Hocoh/redirect_next/blob/master/ui/components/BlogHubTemplate/utils/Pagination/Pagination.js#L13
instead of
window.location.pathname = `blog/page/${pageTargeted}`
shoud be:
Router.push(decodeURIComponent(`blog/page/${pageTargeted}`))
10 code line
https://github.com/Hocoh/redirect_next/blob/master/ui/components/BlogHubTemplate/utils/Pagination/PaginationMain/PaginationMain.js#L10
instead of:
window.location.pathname = `blog/page/${pageTargeted}`
should be:
Router.push(decodeURIComponent(`blog/page/${pageTargeted}`))
code line 31
https://github.com/Hocoh/redirect_next/blob/master/ui/components/BlogHubTemplate/BlogHubTemplate.js#L31
instead of:
Router.replace(`/${postCategory}/${postTitle}`);
should be:
Router.push(decodeURIComponent(`/${postCategory}/${postTitle}`));
and add decodeURIComponent
to another files
@HoCo_ github.com/Hocoh/redirect_next/pull/1
– аlex dykyі
Nov 21 '18 at 23:33
@HoCo_ pls define here your routes github.com/Hocoh/redirect_next/blob/master/ui/routes.js , you can just write in comments your routes, and I will it rewrite it to nextjs routes
– аlex dykyі
Nov 22 '18 at 11:04
add a comment |
This is not a next.js issue
just add decodeURIComponent
in every place where you use window.location.pathname
28 code line https://github.com/Hocoh/redirect_next/blob/master/ui/pages/post.js#L29
instead of:
var postFullPath = window.location.pathname.substr(1) ;
shuld be:
var postFullPath = decodeURIComponent(window.location.pathname).substr(1) ;
38 code line https://github.com/Hocoh/redirect_next/blob/master/ui/pages/blog.js#L38
instead of:
var pageTargeted = window.location.pathname.substr(11) ;
shuld be:
var pageTargeted = decodeURIComponent(window.location.pathname).substr(11) ;
13 code line
https://github.com/Hocoh/redirect_next/blob/master/ui/components/BlogHubTemplate/utils/Pagination/Pagination.js#L13
instead of
window.location.pathname = `blog/page/${pageTargeted}`
shoud be:
Router.push(decodeURIComponent(`blog/page/${pageTargeted}`))
10 code line
https://github.com/Hocoh/redirect_next/blob/master/ui/components/BlogHubTemplate/utils/Pagination/PaginationMain/PaginationMain.js#L10
instead of:
window.location.pathname = `blog/page/${pageTargeted}`
should be:
Router.push(decodeURIComponent(`blog/page/${pageTargeted}`))
code line 31
https://github.com/Hocoh/redirect_next/blob/master/ui/components/BlogHubTemplate/BlogHubTemplate.js#L31
instead of:
Router.replace(`/${postCategory}/${postTitle}`);
should be:
Router.push(decodeURIComponent(`/${postCategory}/${postTitle}`));
and add decodeURIComponent
to another files
This is not a next.js issue
just add decodeURIComponent
in every place where you use window.location.pathname
28 code line https://github.com/Hocoh/redirect_next/blob/master/ui/pages/post.js#L29
instead of:
var postFullPath = window.location.pathname.substr(1) ;
shuld be:
var postFullPath = decodeURIComponent(window.location.pathname).substr(1) ;
38 code line https://github.com/Hocoh/redirect_next/blob/master/ui/pages/blog.js#L38
instead of:
var pageTargeted = window.location.pathname.substr(11) ;
shuld be:
var pageTargeted = decodeURIComponent(window.location.pathname).substr(11) ;
13 code line
https://github.com/Hocoh/redirect_next/blob/master/ui/components/BlogHubTemplate/utils/Pagination/Pagination.js#L13
instead of
window.location.pathname = `blog/page/${pageTargeted}`
shoud be:
Router.push(decodeURIComponent(`blog/page/${pageTargeted}`))
10 code line
https://github.com/Hocoh/redirect_next/blob/master/ui/components/BlogHubTemplate/utils/Pagination/PaginationMain/PaginationMain.js#L10
instead of:
window.location.pathname = `blog/page/${pageTargeted}`
should be:
Router.push(decodeURIComponent(`blog/page/${pageTargeted}`))
code line 31
https://github.com/Hocoh/redirect_next/blob/master/ui/components/BlogHubTemplate/BlogHubTemplate.js#L31
instead of:
Router.replace(`/${postCategory}/${postTitle}`);
should be:
Router.push(decodeURIComponent(`/${postCategory}/${postTitle}`));
and add decodeURIComponent
to another files
edited Nov 21 '18 at 22:15
answered Nov 21 '18 at 21:47
аlex dykyіаlex dykyі
1,9261326
1,9261326
@HoCo_ github.com/Hocoh/redirect_next/pull/1
– аlex dykyі
Nov 21 '18 at 23:33
@HoCo_ pls define here your routes github.com/Hocoh/redirect_next/blob/master/ui/routes.js , you can just write in comments your routes, and I will it rewrite it to nextjs routes
– аlex dykyі
Nov 22 '18 at 11:04
add a comment |
@HoCo_ github.com/Hocoh/redirect_next/pull/1
– аlex dykyі
Nov 21 '18 at 23:33
@HoCo_ pls define here your routes github.com/Hocoh/redirect_next/blob/master/ui/routes.js , you can just write in comments your routes, and I will it rewrite it to nextjs routes
– аlex dykyі
Nov 22 '18 at 11:04
@HoCo_ github.com/Hocoh/redirect_next/pull/1
– аlex dykyі
Nov 21 '18 at 23:33
@HoCo_ github.com/Hocoh/redirect_next/pull/1
– аlex dykyі
Nov 21 '18 at 23:33
@HoCo_ pls define here your routes github.com/Hocoh/redirect_next/blob/master/ui/routes.js , you can just write in comments your routes, and I will it rewrite it to nextjs routes
– аlex dykyі
Nov 22 '18 at 11:04
@HoCo_ pls define here your routes github.com/Hocoh/redirect_next/blob/master/ui/routes.js , you can just write in comments your routes, and I will it rewrite it to nextjs routes
– аlex dykyі
Nov 22 '18 at 11:04
add a comment |
Thanks for contributing an answer to Stack Overflow!
- Please be sure to answer the question. Provide details and share your research!
But avoid …
- Asking for help, clarification, or responding to other answers.
- Making statements based on opinion; back them up with references or personal experience.
To learn more, see our tips on writing great answers.
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
StackExchange.ready(
function () {
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f52719993%2fnextjs-how-handle-redirect-meanwhile-my-strategy-returns-an-error%23new-answer', 'question_page');
}
);
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
If you have a repo with the minimum reproducible setup that would be awesome.
– Divyanshu Maithani
Nov 15 '18 at 17:22
here the repo: github.com/Hocoh/redirect_next . It should specifically reproduce the case and when you will try to go on the blog post's page, you'll firstly have a 404 error, come back to me if you have any question, you can launch the repo with "yarn dev" command, thanks
– HoCo_
Nov 17 '18 at 14:56
@HoCo_ you can add me as contributor to your repo, and I will window.location in all files, my github: odykyi
– аlex dykyі
Nov 21 '18 at 22:04