Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

reactjs component is not getting recognised when its used as under lazy loading #57

Open
raghavendra87 opened this issue Oct 28, 2022 · 1 comment

Comments

@raghavendra87
Copy link

Hi Dev,

Few of the components are not getting recognized. When used as lazy loading component.

const SamplePage= lazy(() => import('./Sample/components/index'));

Used as route like

I tried using escodegen.generate(node.expression) but it only returns the constant to find the actual component.

This component is not getting added to raw report.

But when i changed it to import SamplePagefrom './SamplePage/components/index'; the component getting recognized. But there are so many like i cant use this.

Can you please suggest how to add this to the component tree ?

Can you please do some youtube on customization and executing constant defined in the module to inject them in jsx.

Thank you for the work much useful for us.

@cbfrance
Copy link

I also have this problem, in my case it results in most of my components not being counted.

The repo I am trying to set up has webpack's optimized / lazy imports like this:

OrgMembers: lazy( () => import(/* webpackChunkName: 'org-users-vNext' */ './users/OrgMembers') ),

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants