This repository was archived by the owner on Nov 22, 2024. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 480
This repository was archived by the owner on Nov 22, 2024. It is now read-only.
Does Universal support tilde (~)operator in scss imports? #1098
Copy link
Copy link
Closed
Description
Bug Report
I created a fresh Angular7 (scss) project with ng new and ran following commands (ref):
ng add @nguniversal/express-engine --clientProject my-project-name
npm run build:ssr && npm run serve:ssr
This enabled server side rendering on port 4000.
Everything fine till this point.
Now I added a main.scss. and then in my app.component.scss, I imported with the tilde syntex as follows:
@import "~src/main.scss";
Now on running npm run build:ssr && npm run serve:ssr
I get following error:
ERROR in Module build failed (from ./node_modules/sass-loader/lib/loader.js):
@import "~src/main.scss";
^
File to import not found or unreadable: ~src/main.scss.
in D:\nodebook2\angular-universal-test\src\app\app.component.scss (line 1, column 1)
npm ERR! code ELIFECYCLE
npm ERR! errno 1
npm ERR! angular-universal-test@0.0.0 build:client-and-server-bundles: `ng build --prod && ng run angular-universal-test:server:production
What is the expected behavior?
Universal should be compatible with ~ operator in scss import.
What is the current behavior?
Universal throws error when it sees ~ operator in scss import.
Output from: ng --version
.
Node: 8.11.3
OS: win32 x64
Angular: 7.0.4
... animations, common, compiler, compiler-cli, core, forms
... http, language-service, platform-browser
... platform-browser-dynamic, platform-server, router
Package Version
-----------------------------------------------------------
@angular-devkit/architect 0.10.7
@angular-devkit/build-angular 0.10.7
@angular-devkit/build-optimizer 0.10.7
@angular-devkit/build-webpack 0.10.7
@angular-devkit/core 7.0.7
@angular-devkit/schematics 7.0.7
@angular/cli 7.0.7
@ngtools/webpack 7.0.7
@schematics/angular 7.0.7
@schematics/update 0.10.7
rxjs 6.3.3
typescript 3.1.6
webpack 4.19.1
cbstodd, jsychova and bayucandra
Metadata
Metadata
Assignees
Labels
No labels