【问题标题】:`JS: Error: Css styling failed: missing '{'` in nativescript-dev-sass plugin`JS:错误:Css 样式失败:nativescript-dev-sass 插件中缺少'{'`
【发布时间】:2017-10-03 18:35:24
【问题描述】:

安装nativescript-dev-sass插件后,我将/app目录下的app.css文件重命名为app.scss,这样我就可以在文件中写sass了。 css 文件包含一个导入语句,因此我将其更改为:

@import 'nativescript-theme-core/css/sky.css';

@import '~nativescript-theme-core/css/sky.css'; //notice the tilde

我正在使用 nativescript-dev-sass 存储库的自述文件中提到的波浪号:https://github.com/NativeScript/nativescript-dev-sass

当我运行 tns run android 时,我的应用启动时出现以下错误:

JS: Error: Css styling failed: Error: /data/data/io.myapp.app/files/app/app.css:1:97: missing '{'

app.scss 编译得到的app.css 文件具有以下行:

@import url(C:\my_workspace\myapp\node_modules\nativescript-theme-core\css\sky.css)

如错误消息中所述,该行的第 97 列是右括号 ) 之后的列,并且确实不应该有 { 。所以我不知道为什么它说 { 不见了。

我能做些什么来解决这个问题?

【问题讨论】:

    标签: css sass nativescript angular2-nativescript


    【解决方案1】:

    可能是你需要使用

    @import '~nativescript-theme-core/scss/sky';  // #theme variables
    

    而不是

    @import '~nativescript-theme-core/css/sky.css'; //notice the tilde
    

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 2021-07-25
      • 1970-01-01
      • 1970-01-01
      • 2019-07-09
      • 2023-03-12
      • 1970-01-01
      • 2019-07-06
      • 1970-01-01
      相关资源
      最近更新 更多