Next.js Discord

Discord Forum

Loading CSS results in 404 in Dockerized Next.js

Unanswered
Giant Angora posted this in #help-forum
Open in Discord
Giant AngoraOP
So I recently stumbled upon the dockerized version of Next.js, which I wanted to utilise because I kept on having problem with the _next folder.

I use the "official" Dockerfile that you have on your repository.
Regarding next.config.js:

/** @type {import('next').NextConfig} */
const nextConfig = {
reactStrictMode: true,
i18n: {
locales: ['en', 'sv', 'fi'],
defaultLocale: 'en',
localeDetection: false
},
compiler: {
removeConsole: false,
},
output: 'standalone',
}

module.exports = nextConfig

Folder structure:

src
-> pages
-> style

_app.tsx is in pages.
in styles I have my css file called style.css

it is imported in _app.tsx like:

import '../styles/style.css'

0 Replies