The "Find Usages" feature in Intellij does not have functionality across Lerna packages

I've set up a monorepo with typescript using Lerna, but I'm encountering a bug or misconfiguration related to the "find usages" feature.

You can find a demo of the issue in my GitHub repo here: https://github.com/mcclaskc/IntellijLernaExample

Let's say we have package A with function a(), and package B which depends on A in its package.json file and uses a().

In Intellij, when I try to "find usages" of a() at its declaration in package A, it doesn't show any results. However, if I click on the usage of a() within package B and then try to "go to declaration" of a(), it successfully navigates me back to the declaration in package A.

Given that "go to declaration" is working, I believe Intellij recognizes the dependency in one direction, but I need to determine how to make it work in both directions for "find usages".

So far, I've tried modifying the scope options in Find Usages, but without success.

Answer №1

The issue arises from having separate IDEA modules created for your Lerna packages. The limitation lies in the fact that JavaScript/Typescript usages cannot be detected across these module boundaries. While you can easily navigate to exported functions through explicit imports, searching for usages within submodules will yield no results. There is a request for a feature that would support multi-module apps, which can be found at WEB-37907. You are encouraged to vote for this feature if you find it useful. In the meantime, it is recommended to maintain all Typescript code within a single IDEA module.

Similar questions

If you have not found the answer to your question or you are interested in this topic, then look at other similar questions below or use the search

Steps for integrating the -toDataURL() method on a node.js server

As a newcomer to webgl implementation in my project, I am facing an issue with the .toDataURL() function while using the node-webgl wrapper on the server side. The error I encounter states that .toDataURL() is undefined. More information on this error can ...

Using Flexbox to ensure two elements do not appear next to each other

When viewing on large screens, I want all elements to be on one row. On smaller screens, I want them to be on three rows. Specifically, I don't want to see the button next to the H1 element on the same row. How can flexbox help solve this problem? Tha ...

Creating a Node.js API using express and mysql to retrieve various data including record count, page number, and implementing pagination functionality

How can I efficiently retrieve and display total_record_count, page_number, page_size, total_pages, has_more information in the response while implementing pagination given that I am limiting my query to 100 results? What would be the most effective approa ...

Comprehending the Syntax of the ExtJS Framework

I have recently inherited a project utilizing Sencha's ExtJS framework without any handover or documentation. As I navigate through the code, I find myself trying to decipher certain syntax and exploring resources tailored for newcomers to this specif ...

The type of the element is implicitly set to 'any' because the expression 'keyof IMyObj' cannot be used to index the type

Trying to avoid specifying types in TypeScript and setting a value by accessing its key is causing a TypeScript error. Despite looking at multiple StackOverflow posts, I couldn't find a solution. I encountered a similar issue with my code and tried r ...

JavaScript, XML, and PHP all support the use of HTML entities within their code

Having some trouble as a newbie again))) Can you please help me out, guys? I'm having an XML file with the following data: <Page> <Content>&lt;p&gt;Article content&lt;/p&gt;&#13; &#13; &lt;h1 style="font-style ...

Updating the functionality of one-page scrolling - changing to overlap instead of sliding upwards

Hello, I am currently utilizing a JavaScript library to create a website with full page scrolling. If you want to know about the library, check out this link: For those interested, here is an example of my work on jsfiddle: http://jsfiddle.net/aLjLjxux/ ...

Is there a way to retrieve all potential string literals from an Array<>?

Can something similar be achieved in TypeScript? const options: Array<'Option1' | 'Option2' | 'Option3'> = []; // specify all available options: 'Option1' | 'Option2' | 'Option3' as show ...

Passing parameters to an Angular CLI ejected app

Currently, I am utilizing @angular/[email protected]. I have leveraged the new eject feature to modify the webpack configuration. Now, I find myself perplexed on how to pass parameters to my build process. For instance, how can I execute ng build --p ...

Error: The CommentsSection function did not return any values after rendering

I've been working on a project to create a simple web page that features multiple Material UI card components and integrates Redux to simulate a basic social media platform. The main issue I'm encountering is that when I try to expand a card, an ...

`Cannot recompile the `Product` model as it has already been compiled. Please try again

I attempted to reference my productSchema within my purchaseSchema but encountered the following error: OverwriteModelError: Cannot overwrite Product model once compiled. What steps can I take to resolve this issue? Here is my product schema: mongoose = ...

Developing a new React application with Access Control List (ACL) and encountering an issue with Casl

I've recently started working with casl and it feels like I might be overlooking something crucial. So, I created a file named can.js which closely resembles the example provided in the documentation: import { createContext } from 'react'; i ...

What is the process for creating a loading screen using three.js?

I have a plethora of textures and models that need to be loaded into my project. In order to display a progress bar while everything is loading, I believe the LoadingManager will work perfectly as it monitors the progress of all loaded assets. Currently, ...

Trigger Vue method when the size of a div element changes

Is there a way to trigger a method every time the dimensions (width or height) of a div element change? <template> <div> </div> </template> <script> export default { methods: { updateSize() { // ...

Utilizing AngularJS for manipulating a multidimensional array with interdependent select boxes

I have a unique collection of product names along with their respective versions stored in a multidimensional array. My goal is to design an interactive interface that allows users to first select a product from a drop-down menu and then choose the version ...

Converting Interfaces from Typescript to Javascript

Can the interface in typescript be converted into Javascript? If so, what is the process for converting the typescript code shown below into Javascript. interface xyz{ something? : string, somethingStyle? : Textstyle } ...

Submitting form via ajax whenever triggered

I am looking for a way to submit each form individually by clicking on the submit button. My question: How can I send each form separately and display the results accordingly? The code I have tried does not seem to be working, as nothing is being sent and ...

Having difficulties in dynamically swapping audio sources using JavaScript?

It seems like I'm overlooking something simple here. The issue I'm facing involves creating a series of buttons with different audio sources as titles. When a user clicks on a button, the corresponding source should update in the audio player. T ...

The function ajax does not recognize response.forEach as a valid function

When I try to use ajax for fetching data from MySQL using PHP and JavaScript, I encounter a function error stating "response.forEach is not a function". Despite looking through various posts on this issue, none of the suggested solutions have been able to ...

Struggling to transfer information between POST and GET requests in Node/Express

Just diving into node/express, currently developing a weather application that receives location data from a form submission <form method="POST" action="/"> <input id="input" type="text" name="city" placeholder="Search by city or zip code" /> ...