SassError找不到要导入的样式表@import“ionic.globals”;

pvabu6sv  于 2023-04-27  发布在  Ionic
关注(0)|答案(1)|浏览(396)

尝试更新我的项目从离子3到5,当我做离子服务得到了这个:

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.
4jb9z9bj

4jb9z9bj1#

./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.

相关问题