Styles not compiling

Hi!
Im trying to run yarn build but i get this error:

ERROR in /Users/Eliel/Sites/Valet/framja/wp-content/themes/framja/node_modules/extract-text-webpack-plugin/loader.js??ref–3-0!/Users/Eliel/Sites/Valet/framja/wp-content/themes/framja/node_modules/style-loader/index.js!/Users/Eliel/Sites/Valet/framja/wp-content/themes/framja/node_modules/css-loader/index.js?+sourceMap!/Users/Eliel/Sites/Valet/framja/wp-content/themes/framja/node_modules/postcss-loader/index.js!/Users/Eliel/Sites/Valet/framja/wp-content/themes/framja/node_modules/resolve-url-loader/index.js?+sourceMap!/Users/Eliel/Sites/Valet/framja/wp-content/themes/framja/node_modules/sass-loader/lib/loader.js?+sourceMap!/Users/Eliel/Sites/Valet/framja/wp-content/themes/framja/resources/assets/styles/main.scss doesn’t export content
Child extract-text-webpack-plugin:
[0] /Users/Eliel/Sites/Valet/framja/wp-content/themes/framja/~/css-loader?+sourceMap!/Users/Eliel/Sites/Valet/framja/wp-content/themes/framja/~/postcss-loader!/Users/Eliel/Sites/Valet/framja/wp-content/themes/framja/~/resolve-url-loader?+sourceMap!/Users/Eliel/Sites/Valet/framja/wp-content/themes/framja/~/sass-loader/lib/loader.js?+sourceMap!./styles/main.scss 2.84 kB {0} [built] [failed] [1 error]

I have no clue?
Can you help me get the styles going again?

What’s the content of framja/resources/assets/styles/main.scss?

Just the Sage default scss with bootstrap and fontawesome, haven’t made any changes.

@import “common/variables”;

// Import npm dependencies
@import “~font-awesome/scss/font-awesome”;
@import “~bootstrap/scss/bootstrap”;

// Import theme styles
@import “common/global”;
@import “components/buttons”;
@import “components/comments”;
@import “components/forms”;
@import “components/wp-classes”;
@import “layouts/header”;
@import “layouts/sidebar”;
@import “layouts/footer”;
@import “layouts/pages”;
@import “layouts/posts”;
@import “layouts/tinymce”;

NO error messages anymore, but still no styles. Tried a fresh install, not compiling scss. No css file in dist.

Hi, are you doing yarn build, or yarn start? I ask because start won’t produce a css file in dist; it injects the CSS directly into browsersync.

Trying both, im only in development, but tied to build aswell.

Styles started to work after i:

  1. Deleted node modules and restored yarn.lock to default
  2. Ran yarn
  3. Ran yarn build and start
  4. made a simple alert in main js file (to test)
  5. made a simple change in scss file

Working, but god its slow…
Takes 4 seconds to inject styles and i get a major flash of unstyled content on every page refresh.

Somethings not right?!

1 Like