SASS works only for server side #1038

Closed
opened 2025-08-09 17:18:38 +00:00 by fergalmoran · 0 comments
Owner

Originally created by @Xeevis on 2/9/2017

Hello, I've been trying to implement SASS support with little success. Prerender seems to be working as server indeed sends formatted page, but within 5 seconds error pops up

Module parse failed: \ClientApp\app\components\home\home.component.scss Unexpected token (1:2)
You may need an appropriate loader to handle this file type.

Here are the steps I took:

  1. Used yo aspnetcore-spa [0.8.2] to create Angular 2.4.5 framework
  2. Installed SASS packages npm install sass-loader node-sass --save
  3. Added line to webpack.config.js
    { test: /\.scss$/, include: /ClientApp/, use: ['raw-loader', 'sass-loader'] },
  4. Created new file ClientApp/app/home/home.component.scss with simple rule
    p { color: red !important; }
  5. Added refrence to new file in home.component.ts
    styleUrls: ['./home.component.scss']

Any idea what I'm missing or doing wrong?

*Originally created by @Xeevis on 2/9/2017* Hello, I've been trying to implement SASS support with little success. Prerender seems to be working as server indeed sends formatted page, but within 5 seconds error pops up > Module parse failed: \ClientApp\app\components\home\home.component.scss Unexpected token (1:2) You may need an appropriate loader to handle this file type. Here are the steps I took: 1. Used `yo aspnetcore-spa` [0.8.2] to create Angular 2.4.5 framework 2. Installed SASS packages `npm install sass-loader node-sass --save` 3. Added line to **webpack.config.js** `{ test: /\.scss$/, include: /ClientApp/, use: ['raw-loader', 'sass-loader'] },` 4. Created new file _ClientApp/app/home/home.component.scss_ with simple rule `p { color: red !important; }` 5. Added refrence to new file in _home.component.ts_ `styleUrls: ['./home.component.scss']` Any idea what I'm missing or doing wrong?
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: github/JavaScriptServices#1038
No description provided.