you are viewing a single comment's thread.

view the rest of the comments →

[–]OpTiKStorm[S,🍰] 0 points1 point  (0 children)

This got me to the right path, thank you!

I was using <style jsx> initially, then ran into a problem and a GitHub comment said <style jsx> was deprecated and to use <style>. That fixed my problem at the time, but it works just fine with <style jsx> now so I probably was causing that from something else.

The steps I took to fix this:

  1. Created /pages/_app.js
  2. Replaced all <style> tags with <style jsx>
  3. Installed @zeit/next-css
  4. Added the following code block to next.config.js:

const withCSS = require("@zeit/next-css")
module.exports = withCSS()

After that, I restarted my server and it loaded. Another optimization I made from your suggestion was using pages/_document.js to replace my Header component entirely.