【问题标题】:Intellij IDEA: "Cannot find declaration to go to" - message in a new javascript projectIntellij IDEA:“找不到要转到的声明”- 新 javascript 项目中的消息
【发布时间】:2022-12-22 21:49:40
【问题描述】:

尝试按住 Ctrl 键并单击导入模块的路径时,我收到“无法找到要进入的声明”消息

如果路径包含“@”符号作为根引用,则会显示此消息。

在我的新项目中出现了这种情况,而在旧项目中没有这样的问题。

如何解决这个问题?

【问题讨论】:

  • @ 可能是路径别名;你在哪里定义的?
  • @lena 我还没有定义它

标签: javascript intellij-idea


【解决方案1】:

这是解决方案:

根据https://www.jetbrains.com/help/idea/using-webpack.html#edit_webpack_configuration_file

更新: 还要确保文件 /.idea/workspace.xml 中属性“settings.editor.selected.configurable”=“preferences.pluginManager”的值:

<component name="PropertiesComponent">
    ...
    <property name="settings.editor.selected.configurable" value="preferences.pluginManager" />
    ...
</component>

【讨论】:

    【解决方案2】:

    并将 src 目录标记为源根目录

    【讨论】:

      猜你喜欢
      • 2018-05-25
      • 1970-01-01
      • 2022-12-15
      • 2021-07-17
      • 2016-07-12
      • 2015-07-02
      • 2019-01-23
      • 2016-01-12
      • 2013-04-02
      相关资源
      最近更新 更多