We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
When I import a LESS file in _document.js, it renders using run dev, but when I build and use run start, the style from global.less is not rendered.
LESS files seem to render properly everywhere BUT _document.js.
npm run dev global.less in _document.js is rendered properly.
npm run start global.less in _document.js is not rendered.
import '../src/less/global.less' export default class Template extends Document { static async getInitialProps(ctx) { const initialProps = await Document.getInitialProps(ctx) return { ...initialProps } } render() { return ( <html lang='en_US'> <Head> <link rel="stylesheet" href="/_next/static/style.css" /> <Typekit kitId='dxm1wgv'/> </Head> <body className="custom_class"> <Main /> <NextScript /> </body> </html> ) } }
LESS files used in _document.js should render in DEV and PRODUCTION.
The text was updated successfully, but these errors were encountered:
I moved my global LESS to a Layout component, and it rendered just, so I don't know why _document.js wouldn't work, but I guess it doesn't matter!
Sorry, something went wrong.
_document should't be used for anything other than html structure / css-in-js. Instead use _app.js for your business logic (css etc)
No branches or pull requests
Bug report
Describe the bug
When I import a LESS file in _document.js, it renders using run dev, but when I build and use run start, the style from global.less is not rendered.
LESS files seem to render properly everywhere BUT _document.js.
To Reproduce
npm run dev
global.less in _document.js is rendered properly.
npm run start
global.less in _document.js is not rendered.
Expected behavior
LESS files used in _document.js should render in DEV and PRODUCTION.
System information
The text was updated successfully, but these errors were encountered: