Closed hariria closed 1 year ago
I'm having trouble with this stuff too.
Discussion: https://github.com/vercel/next.js/discussions/49098
Question in StackOverFlow: https://stackoverflow.com/questions/76157727/next-js-13-3-appends-txt-to-urls-when-navigating-pages
I also did output: "export" like you do.
I'm waiting the soluition ;(
it doesn't work either for export: standalone
If anyone can suggest or provide fix would be good!
ok i found the fix,
i downgraded next
version to 13.2
npm i next@13.2
and it worked well for me.
ok i found the fix, i downgraded
next
version to13.2
npm i next@13.2
and it worked well for me.
Oh GOD! I fixed it too. I downgraded it version to "13.2.0"
Thanks.
@hariria Nexta doesn't support App Router / output: 'export' yet.
@MangoQuiz the reason it breaks for you is because you're using output: 'export'
incorrectly. You can't use next start
when using output: 'export'
. You have to use a static file server instead.
If you're using next start
it's better to not add output: 'export'
to next.config.js
. Static pages are already the default.
@dhruvilxcode output: 'standalone'
is a different feature, we're working on a fix here: https://github.com/vercel/next.js/pull/49116
@timneutkens Thank you for replying! I'm kinda newbie in web development.
If you don't mind me asking, how can I use a static file server in details? Remove output: 'export'
after build it? or next build
and next start
without output: 'export'
@timneutkens even without standalone export feature, it's not working for that too.
Note: I am using middleware with appDir enabled.
Please open a new issue with a complete reproduction 🙏
ok i found the fix, i downgraded
next
version to13.2
npm i next@13.2
and it worked well for me.
I fixed it too. I downgraded it version to "13.2.3"
even have downgraded to version 13.2.3
, it might work for this Link href
, but anything below 13.3
version would not have export
feature ready if your appDir is true.
experimental: {
appDir: true,
},
either wait for official fix or change from App Router to Page Router
@timneutkens
@hariria Nexta doesn't support App Router / output: 'export' yet.
I have same problem here when I try to deploy SPA project(output: 'export'
) to Nginx, does Nextjs team have any plan to support it?
I have this issue using router.push
with output: "export"
. When I try to navigate to home with router.push("/")
it tries to fetch a .txt file...
I confirm, this is a very strange behavior, I see that in the code for some reason make the concatenation of the path with .txt
maybe we can remove it?
This script solves your problem. Replace the start command with:
package.json
{
"start": "npx serve ./build/"
}
@deyvisonborges I use export
and my docker image has only nginx, I can't run npx, node, etc
This is fixed at least on 13.4.7, could you all please check that?
I confirmed that the version 13.4.7
fixed the link issue with output: 'export'
in next.config.js
, however, if the url path is longer than 56 chars, the link is cut in the middle.
This issue was indeed fixed in this PR: https://github.com/vercel/next.js/pull/50974/files#diff-7b6239af735eba0c401e1a0db1a04dd4575c19a031934f02d128cf3ac813757bR73-R81
@htakemoto happy to take a look at what you're running into, but can't reproduce it. Can you open a new issue that explains how to reproduce it? Thanks!
This closed issue has been automatically locked because it had no new activity for a month. If you are running into a similar issue, please create a new issue with the steps to reproduce. Thank you.
Verify canary release
Provide environment information
Which area(s) of Next.js are affected? (leave empty if unsure)
Routing (next/router, next/navigation, next/link)
Link to the code that reproduces this issue
N/A
To Reproduce
next.config.js
Nextra@2.4.2
)yarn build
to compile as a static site (viaoutput: 'export'
innext.config.js
)npx serve@latest out
Describe the Bug
The
<Link href="/docs" />
components I'm using redirect to "/docs.txt", not "/docs" for some reason. It only happens on static export as well (it's fine when I modify my next.config.js to be a non-static export).Similar to this: https://github.com/vercel/next.js/issues/48414 except I'm using Nextra@2.4.2 and they're using github pages.
Expected Behavior
Expect it to go to "/docs"
Which browser are you using? (if relevant)
No response
How are you deploying your application? (if relevant)
npx serve@latest out