Replies: 2 comments 3 replies
-
Hi @gmantri Thanks for the detailed info. I can see two usecases here:
Please let us know if this works or if you have any other queries. Thanks! |
Beta Was this translation helpful? Give feedback.
-
I ended up replacing Next.JS with CRA + React Router. I opted for Next.JS only for the convenience of its file based routing but in the end it was not worth the time spent on making it work. Routing available through React Router was more than sufficient for my use case. @vivekjilla - Thanks for all your help. I really appreciate it. |
Beta Was this translation helpful? Give feedback.
Uh oh!
There was an error while loading. Please reload this page.
-
I have this NextJS SPA that I want to deploy in Azure Static Web Apps. It's a fairly simple app with some dynamic routes (e.g.
/pages/requests/[id]/*
). Data in my components/routes is fetched through client-side only (no SSR or SSG).At first, I tried to do a static export by setting
output: 'export'
innext.config.js
and that worked well for static routes (e.g.https://myapp.azurestaticapps.net/requests/
) however it gave me a 404 error on dynamic routes (e.g.https://myapp.azurestaticapps.net/requests/7ecf58774844
). I thought this has something to do with static exports and since I do not have a file called7ecf58774844
(or7ecf58774844.html
) inrequests
folder, I am getting this error. I am wondering ifroutes
instaticwebapp.config.json
can help me here.So I removed
output: 'export'
innext.config.js
and tried to rebuild the application. The build directory looks something like the following:What I am not sure about is how to deploy this application manually using
SWA CLI
.When I do something like:
I get the following error messages:
Here's next.config.json:
and here's staticwebapp.config.json:
Tried different combination of routes but to no avail. For example, these are the route settings I tried:
Please note that above settings are when
output: 'export'
innext.config.js
. In this case, the build directory looks something like the following:I believe I am missing something really trivial but I am at a complete loss here. All the examples I have seen are for SSG and make use of GitHub/Azure DevOps which is not my case. Mine is a completely static application and I have to deploy it manually using SWA CLI.
Beta Was this translation helpful? Give feedback.
All reactions