Replies: 81 comments 13 replies
-
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.
-
Just ran into a problem with this :/ Please fix this Vercel |
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.
-
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.
-
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.
-
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.
-
Friends, it will come, not sure when though. |
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.
-
Beta Was this translation helpful? Give feedback.
-
@leerob When do you plan to fix this? Our team is relying on the feature. |
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.
-
@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 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.
-
I'll ask to same question as @alessandro-r-amos; should we wait for a fix? This is quite an issue for my team and we cannot use the app folder as it is. We are using page, but we are afraid of seeing the support for page go without a sound replacement. |
Beta Was this translation helpful? Give feedback.
-
It largely depends on what you meant by "working". The only difference |
Beta Was this translation helpful? Give feedback.
-
It's a bit of a shame that the basic functionality doesn't work in the stable version of Next.js. Before the next, stable version is announced, maybe it would be good to test it first. Building the app in a production environment is rather a must-have. I had an issue with building next on CI and back to the 13.4.13 version solved that issue, but still Migrating to the |
Beta Was this translation helpful? Give feedback.
-
I wouldn't say the |
Beta Was this translation helpful? Give feedback.
-
The odd part here is that this used to work just fine with the app router, so clearly this is possible to support. It seems very much like this limitation is artificial. I use both server-side builds and client side generated (statically generated) code in one single application. The application uses server-side code to mock data prior to be building the static application, and this is necessary for my use case. What is the alternative here? |
Beta Was this translation helpful? Give feedback.
-
@cometyang no downgrade is needed at all, you can stick to the pages folder in Tauri, and even build a true SPA using a JS router https://colinhacks.com/essays/building-a-spa-with-nextjs @goerlitz I agree that when wanting a true SPA (= with exporting, no node server around), Next is not the best fit. I would personnally favour Vite. |
Beta Was this translation helpful? Give feedback.
-
I use Next.js with tauri, so need this feature. It will b e really nice otherwise have to downgrade to a lower version. :-( |
Beta Was this translation helpful? Give feedback.
-
Also have this issue. Have downgraded from 14 to 13.4.13 as a fix in the meantime. Very important feature of various applications I develop that rely on unknown paths to render content based on that path in static export and static hosting enviroments. |
Beta Was this translation helpful? Give feedback.
This comment was marked as spam.
This comment was marked as spam.
-
Yes, if you don’t use output export it works just fine. |
Beta Was this translation helpful? Give feedback.
-
Is this really a bug? Can I continue developing without the output: export until it's fixed? |
Beta Was this translation helpful? Give feedback.
-
Here is a feature request and discussion outlining the issue and solutions more clearly: #55393 (comment) |
Beta Was this translation helpful? Give feedback.
-
One additional thing I noticed is that when you try to "trick" the app router in returning a catch all route it still does not work because // app/posts/[id]/page.js
import PostDetailsPage from "./PostDetailsPage";
export async function generateStaticParams() {
return [{ id: "fallback" }];
}
export default function Page() {
return <PostDetailsPage />;
} // app/posts/[id]/PostDetailsPage
"use client";
import { useParams } from "next/navigation";
export default function PostDetailsPage() {
const { id } = useParams(); // always returns 'fallback' also when you navigate to /posts/1
return <div>Post: {id}</div>;
} {
"rewrites": [
{
"source": "posts/*",
"destination": "/posts/fallback.html"
}
]
} |
Beta Was this translation helpful? Give feedback.
-
@goerlitz |
Beta Was this translation helpful? Give feedback.
-
No, unfortunately not. If you want to develop a fully dynamic SPA where the rendered pages depend on the user status and interactions, you should not use |
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