Skip to content
/ angular-cli Public
  • Notifications You must be signed in to change notification settings
  • Fork 12k
  • Star 26.6k
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

Sign up for GitHub

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Jump to bottom

./src/main.ts - Error: Module build failed (from ./node_modules/@ngtools/webpack/src/ivy/index.js): Error: Transform failed with 1 error: src/app/@theme/layouts/two-columns/two-columns.layout.scss:17:100: ERROR: Unterminated string token 1 error: ERROR: Unterminated string token #24765

Closed
1 task
enurberk opened this issue Feb 23, 2023 · 12 comments
Closed
1 task

./src/main.ts - Error: Module build failed (from ./node_modules/@ngtools/webpack/src/ivy/index.js): Error: Transform failed with 1 error: src/app/@theme/layouts/two-columns/two-columns.layout.scss:17:100: ERROR: Unterminated string token 1 error: ERROR: Unterminated string token #24765

enurberk opened this issue Feb 23, 2023 · 12 comments

Comments

@enurberk
Copy link

enurberk commented Feb 23, 2023

Command

update

Is this a regression?

  • Yes, this behavior used to work in the previous version

The previous version in which this bug was not present was

Angular 8.0.2

Description

I update my angular project 8.0.2 to 15.1.5 using this link
I followed Angular Update Guide instruction and i faced up with this errors.

./src/main.ts - Error: Module build failed (from ./node_modules/@ngtools/webpack/src/ivy/index.js):
Error: Transform failed with 1 error:
C:/Users/elifn/OneDrive/Masaüstü/kardemir-angular_17.02.2023/src/app/@theme/layouts/two-columns/two-columns.layout.scss:17:100: ERROR: Unterminated string token

./src/polyfills.ts - Error: Module build failed (from ./node_modules/@ngtools/webpack/src/ivy/index.js):
Error: Transform failed with 1 error:
C:/Users/elifn/OneDrive/Masaüstü/kardemir-angular_17.02.2023/src/app/@theme/layouts/two-columns/two-columns.layout.scss:17:100: ERROR: Unterminated string token

./src/app/@theme/styles/styles.scss - Error: Module build failed (from ./node_modules/sass-loader/dist/cjs.js):
SassError: Can't find stylesheet to import.
 
 @import '~@nebular/theme/styles/theming';

  src\app\@theme\styles\themes.scss 2:9  @import
  src\app\@theme\styles\styles.scss 6:9  root stylesheet

./src/app/@theme/styles/styles.scss?ngGlobalStyle - Error: Module build failed (from ./node_modules/mini-css-extract-plugin/dist/loader.js):
HookWebpackError: Module build failed (from ./node_modules/sass-loader/dist/cjs.js):
SassError: Can't find stylesheet to import.
  @import '~@nebular/theme/styles/theming';

  src\app\@theme\styles\themes.scss 2:9  @import
  src\app\@theme\styles\styles.scss 6:9  root stylesheet

My Angular Versions
a

Minimal Reproduction

./src/main.ts ->
/**

  • @license
  • Copyright Akveo. All Rights Reserved.
  • Licensed under the MIT License. See License.txt in the project root for license information.
    */
    import { enableProdMode } from '@angular/core';
    import { platformBrowserDynamic } from '@angular/platform-browser-dynamic';

import { AppModule } from './app/app.module';
import { environment } from './environments/environment';

if (environment.production) {
enableProdMode();
}

platformBrowserDynamic().bootstrapModule(AppModule)
.catch(err => console.error(err));

Exception or Error

/node_modules/@ngtools/webpack/src/ivy/index.js ->
"use strict";
/**
 * @license
 * Copyright Google LLC All Rights Reserved.
 *
 * Use of this source code is governed by an MIT-style license that can be
 * found in the LICENSE file at https://angular.io/license
 */
Object.defineProperty(exports, "__esModule", { value: true });
exports.AngularWebpackLoaderPath = exports.AngularWebpackPlugin = exports.default = void 0;
var loader_1 = require("./loader");
Object.defineProperty(exports, "default", { enumerable: true, get: function () { return loader_1.angularWebpackLoader; } });
var plugin_1 = require("./plugin");
Object.defineProperty(exports, "AngularWebpackPlugin", { enumerable: true, get: function () { return plugin_1.AngularWebpackPlugin; } });
exports.AngularWebpackLoaderPath = __filename;

Your Environment

src/app/@theme/layouts/two-columns/two-columns.layout.scss->
@import '../../styles/themes';
@import '~bootstrap/scss/mixins/breakpoints';
@import '~@nebular/theme/styles/global/breakpoints';

@include nb-install-component() {
  .menu-sidebar::ng-deep.scrollable {
    padding-top: nb-theme(layout-padding-top);
  }
}

Anything else relevant?

No response

@alan-agius4
Copy link
Collaborator

alan-agius4 commented Feb 23, 2023

This seems like a bug but we'll need to look at a reproduction to find and fix the problem. Can you setup a minimal repro please?

You can read here why this is needed. A good way to make a minimal repro is to create a new app via ng new repro-app and adding the minimum possible code to show the problem. Then you can push this repository to github and link it here.

This might be related to your directory structure so its really important to get an accurate repro to diagnose this.

@alan-agius4 alan-agius4 added the needs: repro steps We cannot reproduce the issue with the information given label Feb 23, 2023
@Estevete
Copy link

Estevete commented Feb 23, 2023

We are also facing the issue with the imports in scss

@import "~src/styles/_colors.scss";

SassError: Can't find stylesheet to import. @import "~src/styles/_colors.scss";

Angular version 15.2.0

@alan-agius4
Copy link
Collaborator

alan-agius4 commented Feb 23, 2023

@Estevete, that is expected. Please see the changelog for all the breaking changes in version 15.

https://github.com/angular/angular-cli/releases/tag/15.0.0.

@alan-agius4 alan-agius4 closed this as not planned Won't fix, can't repro, duplicate, stale Feb 23, 2023
@alan-agius4 alan-agius4 removed the needs: repro steps We cannot reproduce the issue with the information given label Feb 23, 2023
@enurberk
Copy link
Author

enurberk commented Feb 23, 2023

I changed some of .scss file import paths like ->
@import '~bootstrap/scss/mixins/breakpoints';
@import '/node_modules/bootstrap/scss/mixins/breakpoints';

and then i have different errors now ->
./src/app/@theme/styles/styles.scss - Error: Module build failed (from ./node_modules/sass-loader/dist/cjs.js):
SassError: Undefined mixin.

35 │ @include nb-auth-global();

src\app@theme\styles\styles.scss 35:3 @content
node_modules@nebular\theme\styles\core\theming_install.scss 150:7 @content
node_modules@nebular\theme\styles\core\theming_install.scss 136:7 nb-install-global-with-scss-vars()
node_modules@nebular\theme\styles\core\theming_install.scss 149:5 nb-install()
src\app@theme\styles\styles.scss 31:1 root stylesheet

./src/app/@theme/styles/styles.scss?ngGlobalStyle - Error: Module build failed (from ./node_modules/mini-css-extract-plugin/dist/loader.js):
HookWebpackError: Module build failed (from ./node_modules/sass-loader/dist/cjs.js):
SassError: Undefined mixin.

35 │ @include nb-auth-global();

src\app@theme\styles\styles.scss 35:3 @content
node_modules@nebular\theme\styles\core\theming_install.scss 150:7 @content
node_modules@nebular\theme\styles\core\theming_install.scss 136:7 nb-install-global-with-scss-vars()
node_modules@nebular\theme\styles\core\theming_install.scss 149:5 nb-install()
src\app@theme\styles\styles.scss 31:1 root stylesheet

@alan-agius4
Copy link
Collaborator

alan-agius4 commented Feb 23, 2023

@enurberk, please check the changelog mentioned above.

Imports like the below;

import '~bootstrap/scss/mixins/breakpoints';

Need to be updated to remove the tilde to

import 'bootstrap/scss/mixins/breakpoints';

Also it is worth mentioning that @import in Scss has been deprecated since 2019. Please see https://sass-lang.com/documentation/at-rules/import

Re, the ng new error, the problem is that you are running the ng new command inside a workspace, please run the command outside of a workspace. IE: a directory that does not have an angular.json.

@enurberk
Copy link
Author

enurberk commented Feb 23, 2023

I created repro-app

@enurberk
Copy link
Author

enurberk commented Feb 23, 2023

I updated my imports as you said.
And again i have this errors below:

./src/app/@theme/styles/styles.scss - Error: Module build failed (from ./node_modules/sass-loader/dist/cjs.js):
SassError: Undefined mixin.

33 │ @include nb-auth-global();
│ ^^^^^^^^^^^^^^^^^^^^^^^^^

src\app@theme\styles\styles.scss 33:3 @content
node_modules@nebular\theme\styles\core\theming_install.scss 146:7 @content
node_modules@nebular\theme\styles\core\theming_install.scss 122:3 nb-install-global-with-css-props()
node_modules@nebular\theme\styles\core\theming_install.scss 145:5 nb-install()
src\app@theme\styles\styles.scss 29:1 root stylesheet

./src/app/@theme/styles/styles.scss?ngGlobalStyle - Error: Module build failed (from ./node_modules/mini-css-extract-plugin/dist/loader.js):
HookWebpackError: Module build failed (from ./node_modules/sass-loader/dist/cjs.js):
SassError: Undefined mixin.

33 │ @include nb-auth-global();
│ ^^^^^^^^^^^^^^^^^^^^^^^^^

src\app@theme\styles\styles.scss 33:3 @content
node_modules@nebular\theme\styles\core\theming_install.scss 146:7 @content
node_modules@nebular\theme\styles\core\theming_install.scss 122:3 nb-install-global-with-css-props()
node_modules@nebular\theme\styles\core\theming_install.scss 145:5 nb-install()
src\app@theme\styles\styles.scss 29:1 root stylesheet

and my styles.scss file is like below:
// @import url(' https://fonts.googleapis.com/css?family=Open+Sans:400,600,700&display=swap');
@import "@angular/material/prebuilt-themes/deeppurple-amber.css";
// @import "../../../../node_modules/material-design-icons-iconfont/dist/material-design-icons.css";

// themes - our custom or/and out of the box themes
@import 'themes';

// framework component themes (styles tied to theme variables)
@import '@nebular/theme/styles/globals';
@import '@nebular/theme/styles/all';
@import '@nebular/theme/styles/theming';

@import 'bootstrap/scss/functions';
@import 'bootstrap/scss/variables';
@import "bootstrap/scss/maps";
@import 'bootstrap/scss/mixins';
@import "bootstrap/scss/utilities";
@import "bootstrap/scss/helpers";
@import "bootstrap/scss/utilities/api";

// loading progress bar theme
@import './pace.theme';

@import './layout';
@import './overrides';
@import './_asana';

// install the framework and custom global styles
@include nb-install() {

// framework global styles
@include nb-theme-global();
@include nb-auth-global();

@include ngx-layout();
// loading progress bar
@include ngx-pace-theme();

@include nb-overrides();
};

@alan-agius4
Copy link
Collaborator

alan-agius4 commented Feb 23, 2023

You are getting an undefined mixin Sass error as nb-auth-global is not found.

@enurberk
Copy link
Author

enurberk commented Feb 23, 2023

How can i solve ?
I ran these commands. But it didnt worked.

npm i @nebular/theme
npm i @nebular/auth
npm i sass-mixins

And i tried this solution
Also i tried this solution
But none of them worked.

Could you check my repro-app project ? repro-app (it is made with my old version angular 8)

@alan-agius4
Copy link
Collaborator

alan-agius4 commented Feb 23, 2023

This issue tracker is not suitable for support requests, please repost your issue on StackOverflow.

Angular 8 is also no longer under support.

@enurberk
Copy link
Author

enurberk commented Feb 23, 2023

I guess while updating my project i install packages locally. So when i ran ng new repro-app its created with old version.
I will repost on StackOverFlow.
Thank you for your helps.

@angular-automatic-lock-bot
Copy link

angular-automatic-lock-bot bot commented Mar 26, 2023

This issue has been automatically locked due to inactivity.
Please file a new issue if you are encountering a similar or related problem.

Read more about our automatic conversation locking policy.

This action has been performed automatically by a bot.

@angular-automatic-lock-bot angular-automatic-lock-bot bot locked and limited conversation to collaborators Mar 26, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants
@alan-agius4 @Estevete @enurberk

Footer

© 2024 GitHub, Inc.

两个鬼故事陵园墓地起名魔女的爱情007无暇赴死结局我和僵尸有个约会给钻石钻戒起名字好的家装公司且乐生前一杯酒论语起名公司招商加盟网带曦的名字女孩起名李姓男孩缺木起名字信托投资公司谭 起名姓江怎么起名字给男孩起有诗意的名字电器店起名大全狗年女孩起名姓刘畸形母爱网控软件广东省省长爪zhua跟爪zhao的区别起个韩国服饰店名字起个爱心公益名字菲律宾前总统袁泉夏雨韩姓姑娘起名字劈面的意思是什么给游戏起什么名字好听火命人公司起名字卡其色配什么颜色好看少年生前被连续抽血16次?多部门介入两大学生合买彩票中奖一人不认账让美丽中国“从细节出发”淀粉肠小王子日销售额涨超10倍高中生被打伤下体休学 邯郸通报单亲妈妈陷入热恋 14岁儿子报警何赛飞追着代拍打雅江山火三名扑火人员牺牲系谣言张家界的山上“长”满了韩国人?男孩8年未见母亲被告知被遗忘中国拥有亿元资产的家庭达13.3万户19岁小伙救下5人后溺亡 多方发声315晚会后胖东来又人满为患了张立群任西安交通大学校长“重生之我在北大当嫡校长”男子被猫抓伤后确诊“猫抓病”测试车高速逃费 小米:已补缴周杰伦一审败诉网易网友洛杉矶偶遇贾玲今日春分倪萍分享减重40斤方法七年后宇文玥被薅头发捞上岸许家印被限制高消费萧美琴窜访捷克 外交部回应联合利华开始重组专访95后高颜值猪保姆胖东来员工每周单休无小长假男子被流浪猫绊倒 投喂者赔24万小米汽车超级工厂正式揭幕黑马情侣提车了西双版纳热带植物园回应蜉蝣大爆发当地回应沈阳致3死车祸车主疑毒驾恒大被罚41.75亿到底怎么缴妈妈回应孩子在校撞护栏坠楼外国人感慨凌晨的中国很安全杨倩无缘巴黎奥运校方回应护栏损坏小学生课间坠楼房客欠租失踪 房东直发愁专家建议不必谈骨泥色变王树国卸任西安交大校长 师生送别手机成瘾是影响睡眠质量重要因素国产伟哥去年销售近13亿阿根廷将发行1万与2万面值的纸币兔狲“狲大娘”因病死亡遭遇山火的松茸之乡“开封王婆”爆火:促成四五十对奥巴马现身唐宁街 黑色着装引猜测考生莫言也上北大硕士复试名单了德国打算提及普京时仅用姓名天水麻辣烫把捣辣椒大爷累坏了

两个鬼故事 XML地图 TXT地图 虚拟主机 SEO 网站制作 网站优化