You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Hi! When using the @nx/vite:build executor, I'd like to be able to set the build.outDir value in my vite.config.ts, rather than needing to specify an outputPath in our project.json or on the NX CLI. This may be the intent already, since the outputPath setting is optional.
When I try to do this and omit the outputPath configuration, an error is thrown:
TypeError [ERR_INVALID_ARG_TYPE]: The "path" argument must be of type string. Received undefined
at new NodeError (node:internal/errors:405:5)
at validateString (node:internal/validators:162:11)
at Object.join (node:path:1175:7)
at joinPathFragments (<path-to-workspace>/node_modules/nx/src/utils/path.js:23:31)
at viteBuildExecutor (<path-to-workspace>/node_modules/@nx/vite/src/executors/build/build.impl.js:45:72)
... rest of stack trace omitted
It looks like the issue might be with this logic, which doesn't check for the whether outputPath exists before trying to create a path using it.
Expected Behavior
If outputPath is not defined in project.json or on the NX CLI, I'd like the value I set in my Vite configuration's build.outDir setting to be used to determine the output directory.
Current Behavior
Hi! When using the
@nx/vite:build
executor, I'd like to be able to set thebuild.outDir
value in myvite.config.ts
, rather than needing to specify anoutputPath
in ourproject.json
or on the NX CLI. This may be the intent already, since the outputPath setting is optional.When I try to do this and omit the
outputPath
configuration, an error is thrown:It looks like the issue might be with this logic, which doesn't check for the whether
outputPath
exists before trying to create a path using it.Expected Behavior
If
outputPath
is not defined in project.json or on the NX CLI, I'd like the value I set in my Vite configuration'sbuild.outDir
setting to be used to determine the output directory.GitHub Repo
https://github.com/wilcoxmd/vite-nx-no-outputPath
Steps to Reproduce
Reproduction steps are listed in the example repo.
Nx Report
Package Manager Version
npm --version
9.8.0
Operating System
Additional Information
Happy to help patch this if you can confirm whether this behavior is or isn't intentional, and provide guidance on any other considerations!
The text was updated successfully, but these errors were encountered: