Error: Projects must list all files or use an ‘include‘ pattern.

import引入文件时,文件明明存在却报错:

File 'xxx/packages/@vue/src/use-list.ts' is not listed within the file list of project 'xxx/packages@/vue/tsconfig.json'. Projects must list all files or use an 'include' pattern.

解决方法:

 在 is not listed within the file 指明的文件中的 include 中添加或修改路径正则。

当前指明路径正则有问题的文件是tsconfig.json,所以到tsconfig.json文件中查看 include项。

tsconfig.json:

{
  "include": ["src"],
}

修改后的 tsconfig.json:

{
  "include": ["src/**/*.ts"],
}

  • 10
    点赞
  • 4
    收藏
    觉得还不错? 一键收藏
  • 2
    评论
这个错误是因为在代码中尝试使用字符串作为列表索引,而不是整数或切片。在Python中,列表的索引必须是整数或切片类型,不能是字符串。因此,当你尝试使用字符串作为索引时,就会导致这个错误的出现。 要解决这个错误,你需要检查代码中使用的索引是否正确。确保你使用的是整数或切片来访问列表中的元素。如果你使用了字符串作为索引,你可以尝试将其更改为正确的类型,或者检查你的代码逻辑以确定你是否真正需要使用字符串来访问列表元素。 例如,在上述引用中,错误信息是"TypeError: list indices must be integers or slices, not str"。这意味着在代码中使用了字符串作为列表索引。要解决这个错误,你可以将字符串索引更改为整数或切片,或者检查代码逻辑以确定是否真正需要使用字符串索引。 总结起来,当出现这个错误时,你应该检查代码中使用的索引类型,并确保它们是整数或切片类型,而不是字符串。<span class="em">1</span><span class="em">2</span><span class="em">3</span> #### 引用[.reference_title] - *1* *2* [Python错误解决:list indices must be integers or slices, not tuple](https://blog.csdn.net/update7/article/details/129775173)[target="_blank" data-report-click={"spm":"1018.2226.3001.9630","extra":{"utm_source":"vip_chatgpt_common_search_pc_result","utm_medium":"distribute.pc_search_result.none-task-cask-2~all~insert_cask~default-1-null.142^v93^chatsearchT3_1"}}] [.reference_item style="max-width: 50%"] - *3* [Python BeautifulSoup [解决方法] TypeError: list indices must be integers or slices, not str](https://download.csdn.net/download/weixin_38590567/14871394)[target="_blank" data-report-click={"spm":"1018.2226.3001.9630","extra":{"utm_source":"vip_chatgpt_common_search_pc_result","utm_medium":"distribute.pc_search_result.none-task-cask-2~all~insert_cask~default-1-null.142^v93^chatsearchT3_1"}}] [.reference_item style="max-width: 50%"] [ .reference_list ]

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论 2
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值