Next.js Discord

Discord Forum

Building a static site still gives the wrong asset paths it seems

Unanswered
Amur catfish posted this in #help-forum
Open in Discord
Amur catfishOP
I've looked all over and can't find an definitive answer to this problem.

I'm exporting a static build of a simple NextJS project with > yarn build

const nextConfig = {
output: "export",
};

However all the links to css files or images start with '/', as in '/_next...'. When viewing the site all of the links are broken. A search/replace on index.html to remove the leading '/' solves the problem.

0 Replies