-
Notifications
You must be signed in to change notification settings - Fork 519
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
rootDirs
workaround does not work as documented
#3423
Comments
If anyone who has worked on this issue has suggestions on how to debug this when it happens, I'd really appreciate it. Every now and then something breaks with this feature and I lose a lot of time trying to guess what combination of I've been trying to upgrade to a newer version of the nodejs rules, and have been unable to because I can't make "rootDirs" work. I've been using "paths" which has worked just fine until the more recent versions: Edit: I've managed to get it to work, and these were my findings:
For me, with my {
"$schema": "https://json.schemastore.org/tsconfig",
"compilerOptions": {
"baseUrl": "./",
"rootDirs": [
"bazel-out/k8-fastbuild/bin"
],
"paths": {
"*": [
"./*",
"bazel-out/k8-fastbuild/bin/*"
]
}
}, |
This issue has been automatically marked as stale because it has not had any activity for 6 months. It will be closed if no further activity occurs in 30 days. Collaborators can add a "cleanup" or "need: discussion" label to keep it open indefinitely. Thanks for your contributions to rules_nodejs! |
I switched to rules_js, which doesn't have this issue. |
🐞 bug report
Affected Rule
The issue is caused by the rule:
ts_project
Is this a regression?
No
Description
The documentation for
ts_project
describes how to set therootDirs
compiler option so that TypeScript can resolve relative references to the bazel-out folder. However, this doesn't work as documented in seemingly simple cases. For example, a project with subdirectoriesa
andb
containing respectivets_project
s, wherea
depends onb
. Based on the documentation,a
'stsconfig.json
should contain:(Paths for additional host architectures omitted because I'm testing solely on macOS.)
🔬 Minimal Reproduction
https://github.com/jfirebaugh/rules_nodejs_test
🔥 Exception or Error
🌍 Your Environment
Operating System: macOS
Output of
bazel version
:Rules_nodejs version:
(Please check that you have matching versions between WORKSPACE file and
@bazel/*
npm packages.)Anything else relevant?
The following patch allows the project to build successfully, but is contrary to what the documentation suggests:
The text was updated successfully, but these errors were encountered: