Skip to content
This repository has been archived by the owner on Jul 6, 2021. It is now read-only.

next build doesn't build CSS into output directory. #226

Closed
chilijung opened this issue Jul 26, 2018 · 3 comments · Fixed by #228
Closed

next build doesn't build CSS into output directory. #226

chilijung opened this issue Jul 26, 2018 · 3 comments · Fixed by #228

Comments

@chilijung
Copy link

Bug report

Issue move from vercel/next.js#4845

Describe the bug

When using @zeit/next-css in next.config.js, in dev mode the CSS successfully built into .next/static/style.css but when using next build to build static version of the app will not generate .next/static/style.css in the directory.

To Reproduce

You could reproduce this error in this demo https://github.com/Canner/canner-demo/tree/master/nextjs-ecom-with-firebase

next.config.js is located: https://github.com/Canner/canner-demo/blob/master/nextjs-ecom-with-firebase/functions/next.config.js

Steps to reproduce the behavior, please provide code snippets or a repository:

  1. run npm run dev in dev mode css is generated.

screen shot 2018-07-26 at 1 02 29 pm

2, run ./node_modules/.bin/next build css is NOT generated in output directory.

screen shot 2018-07-26 at 1 06 33 pm

Expected behavior

When entering next build in output folder it should also generate CSS files.

System information

  • OS: [e.g. macOS, Windows]: mac
  • Browser (if applies) [e.g. chrome, safari]: chrome
  • Version of Next.js: [e.g. 6.0.2]: 6.1.1

Additional context

Add any other context about the problem here.

@gate3
Copy link

gate3 commented Nov 15, 2018

I am currently having issues with mini-css-extract-plugin. I installed @zeit/next-css and i tried importing the css as modules as described in the repo, but i keep getting this error:

Module build failed (from ./node_modules/mini-css-extract-plugin/dist/loader.js):
ModuleParseError: Module parse failed: Unexpected character '' (1:0)
You may need an appropriate loader to handle this file type.

I tried the canary version as well without success.

My current versions are:

"@zeit/next-css": "^1.0.1",
"next": "7.0.2",
 "react": "16.6.1",
 "react-dom": "16.6.1"

I also tried just including the css with href links in the head in the _app.js file that didn't work as well. Any help will be greatly appreciated.

@kachkaev
Copy link
Contributor

@gate3 can you try @zeit/next-css@1.0.2-canary.2 (released just a few hours ago)? Sharing a minimal working example would be useful too. Feel free to open a new issue once you’ve created a small example project and the error still appears there.

@gate3
Copy link

gate3 commented Nov 15, 2018 via email

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants