简体   繁体   English

在 netlify css ./node_modules/gatsby/node_modules/css-loader 上部署失败

[英]Deploy failed on netlify css ./node_modules/gatsby/node_modules/css-loader

I've got a problem on deploying netlify, some conflicts that I don't understand.我在部署 netlify 时遇到了问题,一些我不明白的冲突。 I tried clearing cache, rebuild base, rebuild packages, redeploy on netlify, reinstall mini-CSS-extract-plugin.我尝试清除缓存,重建基础,重建包,在 netlify 上重新部署,重新安装 mini-CSS-extract-plugin。

Debug Netlify:调试 Netlify:

11:38:12 AM: warning chunk styles [mini-css-extract-plugin] 11:38:12 AM: Conflicting order.上午 11:38:12:警告块样式 [mini-css-extract-plugin] 上午 11:38:12:顺序冲突。 Following module has been added: 11:38:12 AM: * css ./node_modules/gatsby/node_modules/css-loader??ref--12-oneOf-1-1!./node_modules/postcss-loader/lib??postcss-2!./node_modules/typeface-roboto/index.css 11:38:12 AM: despite it was not able to fulfill desired ordering with these modules: 11:38:12 AM: * css ./node_modules/gatsby/node_modules/css-loader??ref--12-oneOf-1-1!./node_modules/postcss-loader/lib??postcss-2!./node_modules/typeface-montserrat/index.css 11:38:12 AM: - couldn't fulfill desired order of chunk group(s) component---src-pages-404-js添加了以下模块: 11:38:12 AM:* css ./node_modules/gatsby/node_modules/css-loader??ref--12-oneOf-1-1!./node_modules/postcss-loader/lib?? postcss-2!./node_modules/typeface-roboto/index.css 11:38:12 AM:尽管它无法通过这些模块实现所需的排序:11:38:12 AM:* css ./node_modules/gatsby/ node_modules/css-loader??ref--12-oneOf-1-1!./node_modules/postcss-loader/lib??postcss-2!./node_modules/typeface-montserrat/index.css 上午 11:38:12 : - 无法满足块组组件的所需顺序---src-pages-404-js

what does it mean and how to fix it?这是什么意思以及如何解决它?

    "css-loader": {
  "version": "3.4.2",
  "resolved": "https://registry.npmjs.org/css-loader/-/css-loader-3.4.2.tgz",
  "integrity": "sha512-jYq4zdZT0oS0Iykt+fqnzVLRIeiPWhka+7BqPn+oSIpWJAHak5tmB/WZrJ2a21JhCeFyNnnlroSl8c+MtVndzA==",
  "requires": {
    "camelcase": "^5.3.1",
    "cssesc": "^3.0.0",
    "icss-utils": "^4.1.1",
    "loader-utils": "^1.2.3",
    "normalize-path": "^3.0.0",
    "postcss": "^7.0.23",
    "postcss-modules-extract-imports": "^2.0.0",
    "postcss-modules-local-by-default": "^3.0.2",
    "postcss-modules-scope": "^2.1.1",
    "postcss-modules-values": "^3.0.0",
    "postcss-value-parser": "^4.0.2",
    "schema-utils": "^2.6.0"
  }
},
    "mini-css-extract-plugin": {
      "version": "0.8.2",
      "resolved": "https://registry.npmjs.org/mini-css-extract-plugin/-/mini-css-extract-plugin-0.8.2.tgz",
      "integrity": "sha512-a3Y4of27Wz+mqK3qrcd3VhYz6cU0iW5x3Sgvqzbj+XmlrSizmvu8QQMl5oMYJjgHOC4iyt+w7l4umP+dQeW3bw==",
      "requires": {
        "loader-utils": "^1.1.0",
        "normalize-url": "1.9.1",
        "schema-utils": "^1.0.0",
        "webpack-sources": "^1.1.0"
      }
    },

Those warnings are bad order importation CSS modules due to webpack configuration.由于 webpack 配置,这些警告是错误的顺序导入 CSS 模块。 You can remove them by adding the following snippet in your gatsby-node.js :您可以通过在gatsby-node.js添加以下代码段来删除它们:

exports.onCreateWebpackConfig = ({ stage, actions, getConfig }) => {
  if (stage === 'build-javascript') {
    const config = getConfig()
    const miniCssExtractPlugin = config.plugins.find(
      plugin => plugin.constructor.name === 'MiniCssExtractPlugin'
    )
    if (miniCssExtractPlugin) {
      miniCssExtractPlugin.options.ignoreOrder = true
    }
    actions.replaceWebpackConfig(config)
  }
}

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

相关问题 模块构建失败(来自./node_modules/css-loader/dist/cjs.js):CssSyntaxError - Module build failed (from ./node_modules/css-loader/dist/cjs.js): CssSyntaxError Webpack css 加载器问题“!!../../node_modules/css-loader/index.js!./main.css” - Webpack css loader issues "!!../../node_modules/css-loader/index.js!./main.css" ./node_modules/css-loader中发生错误? -在我的styles.css @import“〜bootstrap / dist / css / bootstrap.css”中 - ERROR in ./node_modules/css-loader? - in my styles.css @import “~bootstrap/dist/css/bootstrap.css” 使用 Parcel 从 node_modules 导入 CSS - Importing CSS from node_modules with Parcel 如何处理依赖于.css文件的node_modules内部的模块? - How to deal with modules inside node_modules that depends .css files? 模块构建失败(来自./node_modules/mini-css-extract-plugin/dist/loader.js):ReferenceError:文档未定义 - Module build failed (from ./node_modules/mini-css-extract-plugin/dist/loader.js): ReferenceError: document is not defined Ionic3:从node_modules导入css的最佳方法 - Ionic3 : the best way to import css from node_modules post-css 没有从 node_modules 中找到路径 - post-css not finding paths from node_modules node_modules CSS 文件未在生产 Webpacker 中编译 - node_modules CSS files not compiling in production Webpacker 从meteor 1.4中的node_modules导入css with react - import css from node_modules in meteor 1.4 with react
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM