打字稿找不到模块错误但它有效

时间:2021-02-27 05:59:16

标签: typescript next.js

我已经这样做了几十次,但也许一些简单的事情正在逃避我。 查看附件,我在 .babelrc 和 tsconfig 中设置了别名,尽管我显示的是 @gql,但我还有其他“@utils”“@components”没有被识别,但它们正在解决,因为我的页面加载正常。

我正在使用“Webstorm”。

enter image description here

tsconfig

"baseUrl": ".",
"paths": {
  "*": [
    "/*"
  ],
  "@gql/*": [
    "src/gql/*"
  ],
  "@components/*": [
    "src/components/*"
  ],
  "@utils/*": [
    "src/utils/*"
  ],

babelrc

  "plugins": [
    ["module-resolver", {
      "root": ["."],
      "alias": {
        "@components": "./src/components",
        "@utils": "./src/utils",
        "@gql": "./src/gql",

0 个答案:

没有答案
相关问题