You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Azure Static Web Apps is built to automatically carry out common tasks like installing npm modules and running `npm run build` during each deployment. There are, however, a few settings like the application source folder and the build destination folder that you need to configure manually.
157
157
158
158
1. Click on the **Build** tab to configure the static output folder.
2. Type **out** in the *App artifact location* text box.
163
163
@@ -195,35 +195,35 @@ The reason for this error is because Next.js only generated the home page based
195
195
196
196
1. Update the _next.config.js_ file so that Next.js uses a list of all available data to generate static pages for each framework/library:
197
197
198
-
```javascript
199
-
const data = require('./utils/projectsData');
198
+
```javascript
199
+
const data = require('./utils/projectsData');
200
200
201
-
module.exports = {
202
-
exportTrailingSlash: true,
203
-
exportPathMap: async function () {
204
-
const { projects } = data;
205
-
const paths = {
206
-
'/': { page: '/' },
207
-
};
201
+
module.exports = {
202
+
exportTrailingSlash: true,
203
+
exportPathMap: async function () {
204
+
const { projects } = data;
205
+
const paths = {
206
+
'/': { page: '/' },
207
+
};
208
208
209
-
projects.forEach((project) => {
210
-
paths[`/project/${project.slug}`] = {
211
-
page: '/project/[path]',
212
-
query: { path: project.slug },
213
-
};
214
-
});
209
+
projects.forEach((project) => {
210
+
paths[`/project/${project.slug}`] = {
211
+
page: '/project/[path]',
212
+
query: { path: project.slug },
213
+
};
214
+
});
215
215
216
-
return paths;
217
-
},
218
-
};
219
-
```
216
+
return paths;
217
+
},
218
+
};
219
+
```
220
220
221
-
> [!NOTE]
222
-
> The `exportPathMap` function is an async function, so you can make a request to an API in this function and use the returned list to generate the paths.
221
+
> [!NOTE]
222
+
> The `exportPathMap` function is an async function, so you can make a request to an API in this function and use the returned list to generate the paths.
223
223
224
224
2. Push the new changes to your GitHub repository and wait for a few minutes while GitHub Actions builds your site again. After the build is complete, the 404 error disappears.
225
225
226
-
:::image type="content" source="media/deploy-nextjs/404-in-production-fixed.png" alt-text="404 on dynamic routes fixed":::
226
+
:::image type="content" source="media/deploy-nextjs/404-in-production-fixed.png" alt-text="404 on dynamic routes fixed":::
0 commit comments