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
{{ message }}
This repository has been archived by the owner on Sep 16, 2021. It is now read-only.
ts_library(
name = "client",
srcs = glob(["control.ts", "xray_viewer.ts"]),
tsconfig = "//:tsconfig.json",
node_modules = "@third_party_js//:node_modules", # or "//:node_modules".
)
If I manage my node_modules myself and check it into my repo root, this build rule works. I want to move to bazel managed dependencies though, so I added
for managing my javascript dependencies and depend on the new @third_party_js//:node_modules rule. This now no longer compiles:
third_party/point_cloud_viewer/xray/client/control.ts(17,24): error TS7016: Could not find a declaration file for module 'three'. '/home/hrapp/.cache/ba
zel/_bazel_hrapp/8de0a1069de8d166c668173ca21c04ae/bazel-sandbox/7039943917462986036/execroot/com_lyft_avsoftware/external/third_party_js/node_modules/th
ree/build/three.js' implicitly has an 'any' type.
According to microsoft/TypeScript#13581 (comment), typeRoots is not used for type resolution for modules, i.e. three in this case. It is searched when a node_modules is found in a top level directory for the files that are compiled, that is why it is found if node_modules is checked into my repository.
A possible and easy fix is to add node_modules/@types to paths - so that the type definitions are found. I proposed a fix for this in a separate PR.
The text was updated successfully, but these errors were encountered:
I have the following build rule:
If I manage my
node_modules
myself and check it into my repo root, this build rule works. I want to move to bazel managed dependencies though, so I addedfor managing my javascript dependencies and depend on the new
@third_party_js//:node_modules
rule. This now no longer compiles:I investigated a bit. The problem in the generated
tsconfig.file
(Gist) is in thepath
setting and in thetypeRoots
setting.According to microsoft/TypeScript#13581 (comment),
typeRoots
is not used for type resolution for modules, i.e.three
in this case. It is searched when anode_modules
is found in a top level directory for the files that are compiled, that is why it is found if node_modules is checked into my repository.A possible and easy fix is to add
node_modules/@types
topaths
- so that the type definitions are found. I proposed a fix for this in a separate PR.The text was updated successfully, but these errors were encountered: