Nathanael Derick
Nathanael Derick

Reputation: 41

SassError Can't find stylesheet to import @import "ionic.globals";

Trying to update my project from ionic 3 to 5 and when i do ionic serve got this:

ERROR in ./src/theme/variables.scss (./node_modules/css-loader/dist/cjs.js??ref--14-1!./node_modules/postcss-loader/src??embedded!./node_modules/resolve-url-loader??ref--14-3!./node_modules/sass-loader/dist/cjs.js??ref--14-4!./src/theme/variables.scss)
[ng] Module build failed (from ./node_modules/sass-loader/dist/cjs.js):
[ng] SassError: Can't find stylesheet to import.
[ng]    ╷
[ng] 15 │ @import "ionic.globals";
[ng]    │         ^^^^^^^^^^^^^^^
[ng]    ╵
[ng]   D:\Producao\Ts-CeoMobile_io5\Ts-CeoMobile\src\theme\variables.scss 15:9  root stylesheet
[ng] ERROR in multi (webpack)-dev-server/client?http://0.0.0.0:0/sockjs-node&sockPath=/sockjs-node ./src/main.ts
[ng] Module not found: Error: Can't resolve 'D:\Producao\Ts-CeoMobile_io5\Ts-CeoMobile\src\main.ts' in 'D:\Producao\Ts-CeoMobile_io5\Ts-CeoMobile'
[ng] ERROR in multi ./src/polyfills.ts ./node_modules/@angular-devkit/build-angular/src/angular-cli-files/models/jit-polyfills.js
[ng] Module not found: Error: Can't resolve 'D:\Producao\Ts-CeoMobile_io5\Ts-CeoMobile\src\polyfills.ts' in 'D:\Producao\Ts-CeoMobile_io5\Ts-CeoMobile'
[ng] ERROR in Must have a source file to refactor.

Upvotes: 4

Views: 1243

Answers (1)

Janani Saravanan
Janani Saravanan

Reputation: 1

./src/theme/variables.scss - Error: Module build failed (from ./node_modules/sass-loader/dist/cjs.js):
[ng] SassError: Can't find stylesheet to import.
[ng]   ╷
[ng] 5 │ @import "ionic.globals";
[ng]   │         ^^^^^^^^^^^^^^^
[ng]   ╵
[ng]   src/theme/variables.scss 5:9  root stylesheet



solutions:
Added global.scss manually in the project.
Added polyfills.ts manually in the project.
main.ts was misplaced in my project.
All three files should be created or placed in the src folder.

Upvotes: 0

Related Questions