-
Notifications
You must be signed in to change notification settings - Fork 522
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
No such file or directory on specific @types package #880
Comments
@jmaher409 Can you try deleting your node_modules and rebuilding if you haven't tried that yet? When updating from 0.31.x to 0.32.0 there may be generated BUILD files left in your node_modules that could potentially lead the the failure above. See release notes https://github.com/bazelbuild/rules_nodejs/releases/tag/0.32.0 for more details. Also, we just released 0.32.1 today with some other ts_library fixes. |
Yes I already tried both of those things. I did the following:
Then I started the build from scratch and still hit the issue. |
Are you using bazel managed npm deps? Meaning labels such as |
Yes, I am using bazel managed dependencies. There is only the one target failing and others have the same deps list but still succeed. I may be wrong but this subpath seems a little suspicious (specifically node_modules/node_modules): external/npm/node_modules/node_modules/@types/chai/index.d.ts I'm still new to bazel so that structure might be normal. |
I think I may have found the issue in one of our other dependencies that is referencing @types/chai with a relative path. I'll confirm and then get back to you. |
Yes. The double node_modules is definitely not right so question is how its getting in there. The correct path should be |
I’m fairly certain at this point that the issue is a relative path reference to ../../../node_modules/@types/chai that I found in another dependency. I’m not at my computer at the moment so I can’t try the fix but I’ll follow up as soon as I can. Thanks for the quick support! |
I was able to verify that the above was indeed the cause of the problem. I'll go ahead and close this out. Thanks again and sorry for the false alarm! |
That would do it. I would guess the reason is showed up in 0.32.0 is that |
Ahh that makes sense. The bad reference was in a handwritten d.ts file that was only used for building of that package and not for external consumption. Either way, we found a bug in one of our other libraries so it’s fixed and we are good to go. Thanks again! |
🐞 bug report
Affected Rule
The issue is caused by the rule:ts_library
Is this a regression?
Yes, the previous version in which this bug was not present was: ....Yes, I think it regressed between 0.31.0 and 0.32.0.
Description
The ts_library rule seems to look in the wrong place for for some @types/* packages. I have only seen this with the @types/chai packages and this could be an issue with some other library we use that happens to depend on @types/chai. I'm especially suspicious the latter is true as we have other ts_library calls with the same dep and have no issue.
🔬 Minimal Reproduction
I haven't had the chance to create this yet and I'm hoping this is already a known issue and I'm just doing something wrong. If not I can try to create a reproduction but since it doesn't seem consistent even between our ts_library calls I may not be able to.
🔥 Exception or Error
🌍 Your Environment
Operating System:
Output of
bazel version
:Rules version (SHA):
Anything else relevant?
The text was updated successfully, but these errors were encountered: