Exporting static html with next.js not working properly

Viewed 38

I created a project and want to export it to the static html. I used this command in package.json build" : "next build && next export

After that I run this command to the terminal npm run build. And finally It's give me an out folder.

The problem is, When I try to access html files from out folder, it's showing only html content, without any CSS and js files. I tried many times but It's not working. If anyone help me to get rid of this problem I'll be very very thankful to him.

1

2

3

4

5

React errors 418 and 423 are:

Hydration failed because the initial UI does not match what was rendered on the server.

There was an error while hydrating. Because the error happened outside of a Suspense boundary, the entire root will switch to client rendering.

I'm using these codes in next.config.js file

// /** @type {import('next').NextConfig} */
// const nextConfig = {
//   reactStrictMode: true,
//   swcMinify: true,
// }

// module.exports = nextConfig

module.exports = {
 assetPrefix: './',
 images: {
   unoptimized: true
 }
}
1 Answers

Checked it & it looks like something related to how you have written the HTML check here

Related