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

Sometimes imported jsx/tsx files are not recognised as productionFiles #13

Closed
molszanski opened this issue Oct 16, 2022 · 3 comments
Closed

Comments

@molszanski
Copy link

molszanski commented Oct 16, 2022

I've found that in a test project, ts-morph seems to not properly resolve React components.

const productionFiles = production.getSourceFiles();

// Now resolve dependencies of entry files to find all production files
  production.resolveSourceFileDependencies();
  const productionFiles = production.getSourceFiles();
  debugLogSourceFiles(options, 1, 'Included production source files', productionFiles);

productionFiles simply ignores imports that are React imports

Seems to be a related issue
dsherret/ts-morph#1250

Will follow up with a minimal viable repro / repo later.

@molszanski molszanski changed the title Sometimes jsx/tsx files are not visible Sometimes imported jsx/tsx files are not recognised as productionFiles Oct 16, 2022
@webpro
Copy link
Owner

webpro commented Oct 17, 2022

Thanks for reporting this, happy to look into a repro. Alternatively, you could open a PR with a new folder and some files in tests/fixtures, so we can add (failing) tests right there.

@webpro
Copy link
Owner

webpro commented Oct 24, 2022

I've added a test for tsx files in eda33c4 (this basic spec is green). Any chance you could follow up with a repro?

@molszanski
Copy link
Author

@webpro, hey, sorry, life swarmed me with tasks. Will close the issue for until I have a repro. When I have I will just add it to tests <3

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