I'm building a simple site for a school project using next, and I managed to deploy the next.js app using now, but no styles are being applied. Everything is fine and works (looks) great on localhost but not online (https://spa-ot24z7ugt.now.sh).
I guess it has something to do with the now.json file, but their documentation makes it look like everything will just work out of the box, and it kind of is true, except for the styling. I looked at the documentation and could not find anything and I was wondering if anyone has any experience using now and next.js.
my now.json file:
```{
"version": 2,
"builds": [
{ "src": "next.config.js", "use": "@now/next" }
]
}```
link to the deployed site: https://spa-ot24z7ugt.now.sh
I'm using Head from 'next/head' to generate link a static CSS file.
I had the same issue and the fix for me was to include style.css as static build:
{
"version": 2,
"name": "wp-nextjs",
"public": true,
"builds": [
{ "src": "package.json", "use": "@now/next" },
{ "src": "static/css/style.css", "use": "@now/static" }
]
}
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With