不清楚SCSS错误意外字符''(1:4)

时间:2019-03-22 11:26:23

标签: sass next

我从SCSS收到这个不清楚的错误:Unexpected character '' (1:4)

  

Failed to compile ./components/layout/Layout.scss ModuleParseError: Module parse failed: Unexpected character '' (1:4) You may need an appropriate loader to handle this file type. (Source code omitted for this binary file)

这是我的SCSS文件Layout.scss

@import './sass-tools';
@import './normalize';
@import './custom-base';

.page-wrapper {
    position: relative;
    max-width: $page-max-width;
    margin: 0 auto;

    &.nobp {
        max-width: none;
        width: 1224px;
    }
}

.page-content {
    position: relative;
    background-color: $white;

    .nobp & {
        width: 1024px;
    }
}

这是我的文件夹结构:

./components/layout/
 ∟ Layout.jsx
 ∟ Layout.scss
 ∟ Layout.test.js
 ∟ _fonts.scss
 ∟ _sass-tools.scss
 ∟ custom-base.scss
 ∟ normalize.scss

对我来说,尚不清楚'' (1:4)应该是什么字符。我相信我的Webpack配置还可以,我可以根据需要发布它,但是SCSS在我的项目中到目前为止(与其他文件一起使用)都可以使用。

1 个答案:

答案 0 :(得分:0)

我发现了问题。 SASS编译器的输出是胡说:这就是发生的事情:

Layout.scss导入 custom-base.scss进口 fonts.scss

,其中包含.woff.woff2文件。我想我仍然需要为这些添加一个加载器

相关问题