Skip to content
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

typescript test workspace issue #155

Open
jrmurad opened this issue Oct 19, 2021 · 1 comment
Open

typescript test workspace issue #155

jrmurad opened this issue Oct 19, 2021 · 1 comment
Labels
bug Something isn't working lang-js JavaScript rules specific

Comments

@jrmurad
Copy link

jrmurad commented Oct 19, 2021

Description

I planned to use the typescript test workspace to learn about latest practices for bazel+typescript+grpc.

I noticed it is using ts_library but had read that ts_project is preferred for new code so I was going to try converting.

But before I got to that...

I changed nodejs_test to nodejs_binary and ran bazel run //:test_main. All good.

I wanted to know how the import path was resolving (js_lib/js_lib_pb/demo_pb). I added a line to console.log(demo_pb) and could no longer run without getting an error: Cannot find module 'js_lib/js_lib_pb_demo_pb.js. Seems like the import can get past the typescript compiler but the lib js isn't actually resolved at runtime?

Also, I was wondering how IDE (e.g. VS Code) is supposed to know how to resolve the imports.

@aaliddell
Copy link
Member

From Slack:

  • Works on 3.x.x
  • Likely related to prefix stripping not working in ts_library like it does with js_library
  • Probably needs a fix in rules_nodejs and it’s likely me that missed this in the original stripping PR

@aaliddell aaliddell added bug Something isn't working lang-js JavaScript rules specific labels Oct 20, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working lang-js JavaScript rules specific
Projects
None yet
Development

No branches or pull requests

2 participants