-
Notifications
You must be signed in to change notification settings - Fork 2.4k
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
TS config paths are not correctly resolved when using @nx/vite:test
executor
#22001
Comments
Thank you for bringing this issue to our attention! I want to assure you that I will take a look as soon as I can. Your patience and understanding in this matter is greatly appreciated. |
@Coly010 is there any rough estimate? I know is too much to ask, but just wondering. We wanted update Nx to fix issue with Vitest generator of missing path and now we hit this problem after update 🙈 We really want to move away from Jest, because it blocks us from using ESM :( |
Hi @huv1k, I don't know exactly what blocks you from using ESM with Jest, but I got this setup running in several ESM-based Nx workspace. One of them is open-source, feel free to have a look and send your questions. |
Any updates on this issue? We are facing this issue for any nx version past 17 |
Sorry for the wait everyone, fix is in PR |
…7118) <!-- Please make sure you have read the submission guidelines before posting an PR --> <!-- https://github.com/nrwl/nx/blob/master/CONTRIBUTING.md#-submitting-a-pr --> <!-- Please make sure that your commit message follows our format --> <!-- Example: `fix(nx): must begin with lowercase` --> <!-- If this is a particularly complex change or feature addition, you can request a dedicated Nx release for this pull request branch. Mention someone from the Nx team or the `@nrwl/nx-pipelines-reviewers` and they will confirm if the PR warrants its own release for testing purposes, and generate it for you if appropriate. --> ## Current Behavior <!-- This is the behavior we have today --> Plugins were not being loaded by vitest executor when calling `startVitest` when using a vite config file with a custom name. ## Expected Behavior <!-- This is the behavior we should expect with the changes in this PR --> Correctly load the plugins found in the resolved config file, regardless of the config file name ## Related Issue(s) <!-- Please link the issue being fixed so it gets closed when this is merged. --> Fixes #22001
…7118) <!-- Please make sure you have read the submission guidelines before posting an PR --> <!-- https://github.com/nrwl/nx/blob/master/CONTRIBUTING.md#-submitting-a-pr --> <!-- Please make sure that your commit message follows our format --> <!-- Example: `fix(nx): must begin with lowercase` --> <!-- If this is a particularly complex change or feature addition, you can request a dedicated Nx release for this pull request branch. Mention someone from the Nx team or the `@nrwl/nx-pipelines-reviewers` and they will confirm if the PR warrants its own release for testing purposes, and generate it for you if appropriate. --> ## Current Behavior <!-- This is the behavior we have today --> Plugins were not being loaded by vitest executor when calling `startVitest` when using a vite config file with a custom name. ## Expected Behavior <!-- This is the behavior we should expect with the changes in this PR --> Correctly load the plugins found in the resolved config file, regardless of the config file name ## Related Issue(s) <!-- Please link the issue being fixed so it gets closed when this is merged. --> Fixes #22001 (cherry picked from commit 58cd577)
…27514) This PR ensures that we pass Vite config file to the programmatic `startTest` API from Vitest. It fixes the issue with plugins not loading as well as other issues with the config file not being used. This mainly affects a custom `configFile` option being passed to the executor. The previous fix to additionally load in `plugins` via overrides is causing plugins to load twice when the Vite config file is picked up by Vitest (e.g. #27500). ## Current Behavior <!-- This is the behavior we have today --> ## Expected Behavior <!-- This is the behavior we should expect with the changes in this PR --> ## Related Issue(s) <!-- Please link the issue being fixed so it gets closed when this is merged. --> Fixes #27500, #22001
…27514) This PR ensures that we pass Vite config file to the programmatic `startTest` API from Vitest. It fixes the issue with plugins not loading as well as other issues with the config file not being used. This mainly affects a custom `configFile` option being passed to the executor. The previous fix to additionally load in `plugins` via overrides is causing plugins to load twice when the Vite config file is picked up by Vitest (e.g. #27500). ## Current Behavior <!-- This is the behavior we have today --> ## Expected Behavior <!-- This is the behavior we should expect with the changes in this PR --> ## Related Issue(s) <!-- Please link the issue being fixed so it gets closed when this is merged. --> Fixes #27500, #22001 (cherry picked from commit 402bae2)
This issue has been closed for more than 30 days. If this issue is still occuring, please open a new issue with more recent context. |
Current Behavior
I have been migrating a project from Nx 17.1 to 17.3.2 to integrate the
nx release
flow. When running the generated migration, it bumped thevite
andvitest
dependencies, which triggered some unexpected issues.In a nutshell, here's what we found with @BioPhoton :
vitest
fails to resolve the TS config paths when run through the@nx/vite:test
executor.vitest
(npx vitest --config=<custom-config-file>
), they are running.With this patch (in
node_modules/@nx/vite/src/executors/test/vitest.impl.js
), i suspect that we are forcing vitest to resolve the config file by itself, probably ignoring the otherresolvedOptions
Expected Behavior
I expect the custom Vitest config file to be supported since there is an option (
config
) supported by the executor to declare the configuration file path.GitHub Repo
https://github.com/getlarge/vitest-issue-repro
Steps to Reproduce
npm i
)npx nx run coffee-maker:test
Error: Failed to load url @repro/helpers (resolved id: @repro/helpers) in XXXXX
Nx Report
Failure Logs
Package Manager Version
10.2.4
Operating System
Additional Information
Might be related:
NxViteTsPaths
) + solutions and fixes #21030The text was updated successfully, but these errors were encountered: