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

fix(utils): Load typescript files relative to process current working directory #79

Merged
merged 3 commits into from
Apr 29, 2024

Conversation

lluiscab
Copy link
Contributor

@lluiscab lluiscab commented Dec 17, 2023

What is the purpose of this pull request? (put an "X" next to item)

  • Documentation update
  • Bug fix
  • New feature
  • Other, please explain:

What changes did you make? (Give an overview)

I've been having problems with this plugin due to the folder structure of my project and NEXT_TRANSLATE_PATH not being respected by ts.createProgram(). This change makes sure that the typescript Program created can access the source files correctly and does not return undefined.

It might also be a good idea to throw an error/warning if program.getSourceFile() returns undefined, altering the user of the issue. I've been trying to track down the cause of an issue similar to aralroca/next-translate#1040 (different root cause) and it's been a nightmare trying to debug it without having any information available on whatever or not the plugin was working correctly.

I'd recommend merging #78 first

@lluiscab lluiscab changed the title feat(deps): update typescript to v5.3.3 fix(utils): Load typescript files relative to process current working directory Dec 17, 2023
@aralroca aralroca merged commit f9932a4 into aralroca:main Apr 29, 2024
@aralroca
Copy link
Owner

@lluiscab currently available in 3.0.0-canary.3 pre-release

@lluiscab lluiscab deleted the fix/ts/relative-imports branch April 30, 2024 06:02
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

Successfully merging this pull request may close these issues.

2 participants