【问题标题】:Can't resolve VSCode Typescript Error 2307 when using Import statement使用 Import 语句时无法解决 VSCode Typescript 错误 2307
【发布时间】:2022-06-11 21:25:33
【问题描述】:

考虑一下 SvelteKit 组件中的这个 Typescript 代码

<script lang="ts">
    import userAccount from "$stores/userAccount";
    console.log ($userAccount);
</script>

我在svelte.config.jstsconfig.json 中设置了一些别名。上面的代码工作并注销了 svelte 存储中的数据。但是 VS 代码将 "$stores/userAccount"; 突出显示为 ts2307 错误。无论我做什么,我都无法在 VSCode 中解决这个错误,即使代码可以正常运行。

任何想法为什么会发生这种情况?

【问题讨论】:

  • 你解决了吗?我面临同样的问题。

标签: typescript visual-studio-code sveltekit


猜你喜欢
  • 1970-01-01
  • 2020-08-09
  • 1970-01-01
  • 2021-03-01
  • 2020-10-10
  • 2022-07-09
  • 1970-01-01
相关资源
最近更新 更多