Giter Site home page Giter Site logo

Comments (9)

ennyta avatar ennyta commented on May 4, 2024 3

I managed to fix it.
In webpack.common.js add this part:
{
test: /.scss$/,
exclude: /node_modules/,
loaders: ['raw-loader', 'sass-loader'] // sass-loader not scss-loader
}

and remove scss from this part:
{
test: /.(scss|html|png|jpe?g|gif|svg|woff|woff2|ttf|eot|ico)$/,
use: 'raw-loader'
}

That enables @imports in sass to be resolved and compiled.

from universal.

rahulbpatel avatar rahulbpatel commented on May 4, 2024

I am running into the same thing. I am trying to import Bootstrap via the app.component.scss file:

$icon-font-path: '~bootstrap-sass/assets/fonts/bootstrap/';
@import "~bootstrap-sass/assets/stylesheets/bootstrap";

from universal.

rahulbpatel avatar rahulbpatel commented on May 4, 2024

Actually my issue might be unrelated, I just realized I was missing the bootstrap-sass package. I added it and am running into other issues. Will report back what I find out.

from universal.

rahulbpatel avatar rahulbpatel commented on May 4, 2024

I think that fixed my issue. @paulogr might want to check that file "../../assets/colors" actually exists

from universal.

ennyta avatar ennyta commented on May 4, 2024

I am getting the same error. Any ideas? File is there.

from universal.

ysus avatar ysus commented on May 4, 2024

i can resolve the issue that i have but with font-aweson, basically is the same configuration for both:
{ test: /\.scss$/, use: [{ loader: "to-string-loader" }, { loader: "css-loader" } }, { loader: "resolve-url-loader" }, { loader: "sass-loader", options: { sourceMap: true, data: '@import "styles";', includePaths: [ DIR ] } } ] }, { test: /\.(jpe|jpg|woff|woff2|eot|ttf|svg)(\?.*$|$)/, use: [{ loader: "file-loader" }] }

DIR // const DIR = join(process.cwd(), 'src', 'styles');

inside the style folder i have a file called
styles.scss

@import 'variables';
@import '../../node_modules/font-awesome/scss/font-awesome';
@import 'global';

inside _varibales.scss
$fa-font-path: "../../node_modules/font-awesome/fonts";

repo: https://github.com/FrozenPandaz/ng-universal-demo

from universal.

mohitkadelongraph avatar mohitkadelongraph commented on May 4, 2024

@ennyta
Where should we write this -
{
test: /.scss$/,
exclude: /node_modules/,
loaders: ['raw-loader', 'sass-loader'] // sass-loader not scss-loader
}
in serverConfig or in browserConfig?
If in browserConfig then do we need to remove pre-defined scss rules?

from universal.

ysus avatar ysus commented on May 4, 2024

In webpack.common.js

from universal.

fulls1z3 avatar fulls1z3 commented on May 4, 2024

@paulogr @rahulbpatel @ennyta @mohitkadelongraph @ysus I was able to reproduce this error, and am going to push a fix within a couple of hours, so stay tuned guys.

from universal.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.