【问题标题】:Gatsby: "warn There are multiple modules with names that only differ in casing. This can lead to unexpected behavior..."Gatsby:“警告有多个模块的名称只是大小写不同。这可能导致意外行为......”
【发布时间】:2021-09-17 18:50:33
【问题描述】:

使用按功能分组的文件夹结构构建 Gatsby/React 站点。这是一种相当标准的方法...

但是,如果您使用大写来命名您的文件夹,您最终会在控制台中收到一些投诉:

  warn There are multiple modules with names that only differ in casing.
This can lead to unexpected behavior when compiling on a filesystem with other case-semantic.
Use equal casing. Compare these module identifiers:
* css [path]/node_modules/css-loader/index.js??ref--14-oneOf-1-1!/[path]/node_modules/postcss-loader/src/index.js??postcss-3![path]/node_modules/sa
ss-loader/dist/cjs.js??ref--14-oneOf-1-3![path]/src/components/Layout/layout.scss 0
    Used by 1 module(s), i. e.
    [path]/node_modules/mini-css-extract-plugin/dist/loader.js??ref--14-oneOf-1-0!/[path]/node_modules/css-loader/index.js??ref--14-oneOf-1-1!/[path]/node_modules/postcss-loader/src/index.js??postcss-3![path]/node_modules/sass-loader/dist/cjs.j
s??ref--14-oneOf-1-3![path]/src/components/Layout/layout.scss

【问题讨论】:

    标签: javascript reactjs typescript warnings gatsby


    【解决方案1】:

    将您的文件夹重命名为小写应该可以解决您的警告:

    header/
      index.tsx
      stories.tsx
      style.scss
      test.tsx
    footer/
      index.tsx
      stories.tsx
      style.scss
      index.test.ts
    

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 2020-04-16
      • 2021-05-14
      • 1970-01-01
      • 2019-09-03
      • 2018-12-16
      • 2018-01-08
      • 2018-05-12
      • 1970-01-01
      相关资源
      最近更新 更多