Next.js: How to access the style assets of next@css / next@sass after I change my folder structure?

Created on 12 Mar 2018  路  3Comments  路  Source: vercel/next.js

Thank you for this great framework. I'm using next@sass and I wanna know how to access the styles after I change my folder structure.

Here's my folder strcuture:
root
|---- src
|---- .next
|---- pages
|---- next.config.js

When I run yarn dev my css path is missed:

import Document, { Head, Main, NextScript } from 'next/document'

export default class MyDocument extends Document {
  render() {
    return (
      <html>
        <Head>
          <link rel="stylesheet" href="/_next/static/style.css" /> // <== How to adjust the path?
        </Head>
        <body>
          <Main />
          <NextScript />
        </body>
      </html>
    )
  }
}

Most helpful comment

I'm having the same issue. I have my app inside of ./app directory. I've made the adjustments to the express server & the build command however my css file still 404s.

All 3 comments

I'm having the same issue. I have my app inside of ./app directory. I've made the adjustments to the express server & the build command however my css file still 404s.

@wellyshen see https://github.com/zeit/next.js/issues/4004

I updated to canary as suggested and this issue was resolved.

@jbsmith731 Thanks I'll try it.

Was this page helpful?
0 / 5 - 0 ratings

Related issues

Timer picture Timer  路  90Comments

poyiding picture poyiding  路  73Comments

acanimal picture acanimal  路  74Comments

timneutkens picture timneutkens  路  72Comments

baldurh picture baldurh  路  74Comments