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

The Test workspace for Typescript doesn't work #194

Open
yungwarlock opened this issue May 1, 2022 · 1 comment
Open

The Test workspace for Typescript doesn't work #194

yungwarlock opened this issue May 1, 2022 · 1 comment
Labels
bug Something isn't working

Comments

@yungwarlock
Copy link

Issue Description

I tried the example workspace defined in the test_workspace for typescript.

The test cases work when nothing is done. But doesn't when you try to use the generated protobuf js files.

Here's my description:

import * as grpc from '@grpc/grpc-js';
import * as demo_pb from 'js_lib/js_lib_pb/demo_pb.js';
import * as demo_grpc_pb from 'js_lib/js_lib_pb/demo_grpc_pb.js';

console.log(new demo_pb.demo());

Log Output

exec ${PAGER:-/usr/bin/less} "$0" || exit 1
Executing tests from //:test_main
-----------------------------------------------------------------------------
Error: Cannot find module 'js_lib/js_lib_pb/demo_pb.js'
Require stack:
- /home/gitpod/.cache/bazel/_bazel_gitpod/50eee0b5ac8cdff0f4e9de14fb020547/sandbox/processwrapper-sandbox/837/execroot/__main__/bazel-out/k8-fastbuild/bin/test_main.sh.runfiles/__main__/main.js
    at Function.Module._resolveFilename (internal/modules/cjs/loader.js:889:15)
    at Function.Module._load (internal/modules/cjs/loader.js:745:27)
    at Module.require (internal/modules/cjs/loader.js:961:19)
    at require (internal/modules/cjs/helpers.js:92:18)
    at main.ts:2:1
    at /home/gitpod/.cache/bazel/_bazel_gitpod/50eee0b5ac8cdff0f4e9de14fb020547/sandbox/processwrapper-sandbox/837/execroot/__main__/bazel-out/k8-fastbuild/bin/test_main.sh.runfiles/__main__/main.js:22:17
    at Object.<anonymous> (/home/gitpod/.cache/bazel/_bazel_gitpod/50eee0b5ac8cdff0f4e9de14fb020547/sandbox/processwrapper-sandbox/837/execroot/__main__/bazel-out/k8-fastbuild/bin/test_main.sh.runfiles/__main__/main.js:28:3)
    at Module._compile (internal/modules/cjs/loader.js:1072:14)
    at Object.Module._extensions..js (internal/modules/cjs/loader.js:1101:10)
    at Module.load (internal/modules/cjs/loader.js:937:32)

rules_proto_grpc Version

:master at 2e8be8

Bazel Version

5.1.1

OS

Linux

Link to Demo Repo

https://github.com/rules-proto-grpc/rules_proto_grpc

WORKSPACE Content

No response

BUILD Content

No response

Proto Content

No response

Any Other Content

No response

@yungwarlock yungwarlock added the bug Something isn't working label May 1, 2022
@aaliddell
Copy link
Member

I think this is the same as #155, where the issue is that prefix stripping works with js_library in rules_nodejs, but does not work when that library is then used from TypeScript.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants