【问题标题】:Sage theme build error: Invalid UTF-8 at runLoadersSage 主题构建错误:runLoaders 中的 UTF-8 无效
【发布时间】:2019-01-30 04:10:56
【问题描述】:

我正在用 sage 构建一个主题并将文件夹复制到另一个位置。之后,当我尝试构建项目时,出现此错误:

模块构建失败:ModuleBuildError:模块构建失败:UTF-8 无效 在 runLoaders (/var/www/html/plataforma/wp-content/themes/template-mnm/node_modules/webpack/lib/NormalModule.js:195:19) 在 /var/www/html/plataforma/wp-content/themes/template-mnm/node_modules/loader-runner/lib/LoaderRunner.js:364:11 在 /var/www/html/plataforma/wp-content/themes/template-mnm/node_modules/loader-runner/lib/LoaderRunner.js:230:18 在 context.callback (/var/www/html/plataforma/wp-content/themes/template-mnm/node_modules/loader-runner/lib/LoaderRunner.js:111:13) 在 Object.asyncSassJobQueue.push [作为回调] (/var/www/html/plataforma/wp-content/themes/template-mnm/node_modules/sass-loader/lib/loader.js:55:13) 在对象。 (/var/www/html/plataforma/wp-content/themes/template-mnm/node_modules/async/dist/async.js:2244:31) 在 Object.callback (/var/www/html/plataforma/wp-content/themes/template-mnm/node_modules/async/dist/async.js:906:16) 在 options.error (/var/www/html/plataforma/wp-content/themes/template-mnm/node_modules/node-sass/lib/index.js:294:32)

@multi ./scripts/main.js ./styles/main.scss

./resources/assets/styles/main.scss 中的错误

模块构建失败:ModuleBuildError:模块构建失败:UTF-8 无效 在 runLoaders (/var/www/html/plataforma/wp-content/themes/template-mnm/node_modules/webpack/lib/NormalModule.js:195:19) 在 /var/www/html/plataforma/wp-content/themes/template-mnm/node_modules/loader-runner/lib/LoaderRunner.js:364:11 在 /var/www/html/plataforma/wp-content/themes/template-mnm/node_modules/loader-runner/lib/LoaderRunner.js:230:18 在 context.callback (/var/www/html/plataforma/wp-content/themes/template-mnm/node_modules/loader-runner/lib/LoaderRunner.js:111:13) 在 Object.asyncSassJobQueue.push [作为回调] (/var/www/html/plataforma/wp-content/themes/template-mnm/node_modules/sass-loader/lib/loader.js:55:13) 在对象。 (/var/www/html/plataforma/wp-content/themes/template-mnm/node_modules/async/dist/async.js:2244:31) 在 Object.callback (/var/www/html/plataforma/wp-content/themes/template-mnm/node_modules/async/dist/async.js:906:16) 在 options.error (/var/www/html/plataforma/wp-content/themes/template-mnm/node_modules/node-sass/lib/index.js:294:32)

我认为文件的编码已经改变,有没有办法纠正这个问题?

我真的很感激任何帮助,谢谢!

【问题讨论】:

    标签: wordpress webpack encoding utf-8 roots-sage


    【解决方案1】:

    所以我找到了答案,我会发布它以防万一有人遇到同样的问题。事情是在 main.scss 中导入的 scss 文件之一编码错误。 使用正确的编码保存文件解决了这个问题。

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 2017-09-08
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2012-04-20
      • 1970-01-01
      相关资源
      最近更新 更多