Replies: 82 comments 17 replies
-
Perhaps there are dates when this is scheduled to be done? Or is it better to use Pages Router? FYI: Gatsby allows you to use dynamic routers in static exports without configuring server-side redirects. That's the only thing stopping us from moving our PWAs from Gatsby to Next.js |
Beta Was this translation helpful? Give feedback.
-
I did not see this error on 13.4.13. I started seeing it when I upgraded to 13.5.3. |
Beta Was this translation helpful? Give feedback.
-
Can confirm this is working on 13.4.13. I'm curious if the functionality is therefore a regression or a bug that's become a feature 😅 |
Beta Was this translation helpful? Give feedback.
-
But does it output the static page? If it doesn't and there is no error, then it's definitely a regression. |
Beta Was this translation helpful? Give feedback.
-
@petejodo What does "working" mean in this case? Previously there was no error message but it was failing silently. So in 13.5.0, a helpful error message was added explaining how to fix it. See #48022 (comment) for more details. However maybe there is a case when the error message shouldn't be printed? If you have code that was working with Please do NOT comment on this issue since it describes a new feature that needs to be implemented (not a regression). |
Beta Was this translation helpful? Give feedback.
-
I can confirm that this issue persisted in version 13.4.13 as well. It failed silently as you said; there was no error during the build, but accessing the dynamic route resulted in a 404 error. |
Beta Was this translation helpful? Give feedback.
-
yeah I didn't see that at first and thought that it was working in my testing but I guess I somehow messed something up in my testing where I thought it was working but it definitely was not. Sorry, my mistake! This put me in a bind because I misinterpreted the opening paragraphs to https://nextjs.org/docs/app/building-your-application/deploying/static-exports which made it seem I could port a SPA to nextjs and we just about finished porting it. That's my problem though, not yours' 😅 I think I can re-hack react-router back in even though that was giving me trouble at the start of the project |
Beta Was this translation helpful? Give feedback.
This comment was marked as off-topic.
This comment was marked as off-topic.
-
Hi, is this related to the error encountered in @leerob SPA example? The error message seems surprising, and params are meant to be obtained via page props rather than the |
Beta Was this translation helpful? Give feedback.
-
Hi, I just started learning Next.js and I want to deploy my app as static SPA on Amazon S3. Hence, I added
I'm stuck here. What am I supposed to do to get the dynamic routes working with the static export? Maybe, I'm don't fully understand |
Beta Was this translation helpful? Give feedback.
-
@goerlitz starting step 3 and 4 I think you get confused:
The thing is that if you use a dummy static param, Next only knows the dummy "/datasets/foo" route. So "/datasets/bar" won't work. You could do an URL rewrite from "/datasets/bar" to "/datasets/foo", but then the route parameter is lost. You could opt for a query parameter instead. Sadly until Next.js supports exporting dynamic routes that are not statically rendered like it did in Next 12 |
Beta Was this translation helpful? Give feedback.
-
Thanks @eric-burel for the guidance. Having worked on SPA with Api backends in the past, I thought I could make Next.js output a SPA bundle with separate api code. Actually, I think that the first paragraph in https://nextjs.org/docs/app/building-your-application/deploying/static-exports is quite misleading in that sense:
No, Next.js is not made for SPAs - it is a totally different paradigm with the goal to NOT do all rendering and routing in the browser but move more code to the server where computing is more efficient (SSR etc.). Hence, a typical Next.js app will never be an SPA (and should not be), because the application code is split up and runs on server and client likewise. IMHO, for most applications - that usually have dynamic routing - the static export does not make sense to me at all. |
Beta Was this translation helpful? Give feedback.
-
Does exists on 13.5.5 as well, I have tried to build a view with this routing structure:
on production i had issues for previous versions, [id] was not found and it was navigating to home page, and now not even able to build to the this issue:
|
Beta Was this translation helpful? Give feedback.
-
Can you please give an update, when this feature is planned? I mainly switchedto nextjs, because of the routing functionality. Now it forces me to host on a node server... As a workaround i try out useing pages router again. [https://nextjs.org/docs/pages/building-your-application/routing/pages-and-layouts] |
Beta Was this translation helpful? Give feedback.
-
@andreasfrey, this is what I meant with "Next.js follows a different paradigm" than SPA. If you are trying to use Next.js to create a traditional SPA (with dynamic routes) that can be packaged for hosting on a CDN, then you are doing something (conceptually) wrong. This is not what Next.js was designed for. If you want to move from an SPA to Next.js (with all the nice features, like SSR etc.), you should
|
Beta Was this translation helpful? Give feedback.
-
Another workaround is to switch from using params to search params to get the ID or whatever in the URL |
Beta Was this translation helpful? Give feedback.
-
We finally need a fix for this, is there any new information yet? |
Beta Was this translation helpful? Give feedback.
-
Beta Was this translation helpful? Give feedback.
-
So does Next.js intend to continue to supporting static HTML export or not? Somewhere I found a tweet that said they were but this doesn't seem encouraging. I contend |
Beta Was this translation helpful? Give feedback.
-
This is really disheartening, after building the application just to discovered that I couldn't build the app correctly because of useParams used in the app router. |
Beta Was this translation helpful? Give feedback.
-
It would be helpful to provide a bit of clarity on this after moving the issue from Issues to Discussions / Ideas. Most importantly, does it mean "It's not working as intended" and developers building SPAs should start looking for a framework that treats SPAs as first class citizens? |
Beta Was this translation helpful? Give feedback.
-
I also think Vercel doesn't care about this feature for obvious reasons. It probably won't be supported recently. Is there a workaround for this issue? |
Beta Was this translation helpful? Give feedback.
-
Minimally can we get the title changed? The problem is not that "App Router with |
Beta Was this translation helpful? Give feedback.
-
Friends, it will come, not sure when though. |
Beta Was this translation helpful? Give feedback.
-
Hi all, just wanted to let you know that the issue was moved to discussion, but it not because of de-prioritizing! We have just done some cleanup on the repo, as per our triaging documentation, which states that feature requests are not supposed to be opened as issues. We welcome further discussions on this topic, and will keep tracking it. |
Beta Was this translation helpful? Give feedback.
-
Just ran into a problem with this :/ Please fix this Vercel |
Beta Was this translation helpful? Give feedback.
-
I am migrating my code from CRA (create react app) to next.js and I can't use dynamic routes anymore because of this issue. Please fix it or at least put a workaround/explanation in the migration guide. |
Beta Was this translation helpful? Give feedback.
-
Thanks for the clarifications about the pages router @leerob ! :) I just want to know whether the dev team is planning to add / fix that functionality in the app router or not. If not then I would just migrate back to the pages router. If there's a fix incoming during the next half year however I would just wait. Getting a clarification on the future of this topic would be great! |
Beta Was this translation helpful? Give feedback.
-
Reverting to using paging router worked for me. I feel like there should be an option to run routing in App Router client side though. |
Beta Was this translation helpful? Give feedback.
-
Has there been any progress on this issue yet? I’m currently facing the same problem and wondering if there's a workaround or an update available. |
Beta Was this translation helpful? Give feedback.
-
Verify canary release
Provide environment information
Operating System: Platform: darwin Arch: arm64 Version: Darwin Kernel Version 22.5.0 Binaries: Node: 18.17.1 pnpm: 8.6.12 Relevant Packages: next: 13.4.20-canary.2 react: 18.2.0 react-dom: 18.2.0 Next.js Config: output: export
Which area(s) of Next.js are affected? (leave empty if unsure)
App Router, Static HTML Export (output: "export")
Link to the code that reproduces this issue or a replay of the bug
https://github.com/curated-tests/next-issue-48022
To Reproduce
The page in question is /app/blog-app/[slug]/page.tsx
Describe the Bug
Fails with an error:
This is expected right now because its not implemented, but it would be nice to support this so that App Router can match Pages Router.
Expected Behavior
Ideally, the build should complete and navigation should work client side.
/blog-app/
)/blog-app/one
)Which browser are you using? (if relevant)
Chrome
How are you deploying your application? (if relevant)
python3 -m http.server 3000
NEXT-1550
Beta Was this translation helpful? Give feedback.
All reactions