Skip to content

Cannot find module from external repository after upgrading do 5.0.1 #3291

@adworzynski

Description

@adworzynski

🐞 bug report

Affected Rule

ts_project

Is this a regression?

Yes, the previous version in which this bug was not present was: 4.6.1

Description

After upgrading form version 4.6.1 to 5.0.1 the project no longer compiles.

🔬 Minimal Reproduction

Workspace configuration


http_archive(
    name = "build_bazel_rules_nodejs",
    sha256 = "f690430f4d4cc403b5c90d0f0b21842183b56b732fff96cfe6555fe73189906a",
    urls = ["https://github.com/bazelbuild/rules_nodejs/releases/download/5.0.1/rules_nodejs-5.0.1.tar.gz"],
)

load("@build_bazel_rules_nodejs//:repositories.bzl", "build_bazel_rules_nodejs_dependencies")

build_bazel_rules_nodejs_dependencies()

load("@build_bazel_rules_nodejs//:index.bzl", "yarn_install")

yarn_install(
    name = "npm_commitlint",
    package_json = "//tools/bazel/commitlint:package.json",
    yarn_lock = "//tools/bazel/commitlint:yarn.lock",
)

yarn_install(
    name = "npm_lint",
    package_json = "//tools/bazel/lint:package.json",
    yarn_lock = "//tools/bazel/lint:yarn.lock",
)

yarn_install(
    name = "npm",
    package_json = "//tools/bazel/nodejs:package.json",
    yarn_lock = "//tools/bazel/nodejs:yarn.lock",
)

Build file


ts_project(
    name = "project",
    tsconfig = ":tsconfig",
    deps = ["@npm//fp-ts"],
    srcs = glob(["src/*.ts"]),
    declaration = True,
)

🔥 Exception or Error


ERROR: /home/dworek/projects/myproject/packages/project/BUILD:8:11: Compiling TypeScript project //packages/project:project [tsc -p packages/project/tsconfig.build.json] failed: (Exit 2): tsc.sh failed: error executing command 
  (cd /home/dworek/.cache/bazel/_bazel_dworek/1ce0ed8fd43335e711405d5a1704d0f4/sandbox/linux-sandbox/63/execroot/myproject && \
  exec env - \
    BAZEL_NODE_MODULES_ROOTS=tools/bazel/nodejs \
    COMPILATION_MODE=fastbuild \
  bazel-out/k8-opt-exec-2B5CBBC6/bin/external/npm/typescript/bin/tsc.sh --project packages/project/tsconfig.build.json --outDir bazel-out/k8-fastbuild/bin/packages/project --rootDir packages/project --declarationDir bazel-out/k8-fastbuild/bin/packages/project '--bazel_node_modules_manifest=bazel-out/k8-fastbuild/bin/packages/project/_project_TsProject.module_mappings.json')
# Configuration: 28ff57593ba01d914893f9cd455c859110ce813ccf3771961541220915f453dc
# Execution platform: @local_config_platform//:host

Use --sandbox_debug to see verbose messages from the sandbox
packages/project/src/index.ts(1,21): error TS2307: Cannot find module 'fp-ts' or its corresponding type declarations.

🌍 Your Environment

Operating System:

  
Linux 5.10.16.3-microsoft-standard-WSL2 #1 SMP Fri Apr 2 22:23:49 UTC 2021 x86_64 x86_64 x86_64 GNU/Linux
  

Output of bazel version:

  
Bazelisk version: v1.11.0
Build label: 5.0.0
Build target: bazel-out/k8-opt/bin/src/main/java/com/google/devtools/build/lib/bazel/BazelServer_deploy.jar
Build time: Wed Jan 19 14:08:54 2022 (1642601334)
Build timestamp: 1642601334
Build timestamp as int: 1642601334
  

Rules_nodejs version:

(Please check that you have matching versions between WORKSPACE file and @bazel/* npm packages.)

  
http_archive(
    name = "build_bazel_rules_nodejs",
    sha256 = "f690430f4d4cc403b5c90d0f0b21842183b56b732fff96cfe6555fe73189906a",
    urls = ["https://github.com/bazelbuild/rules_nodejs/releases/download/5.0.1/rules_nodejs-5.0.1.tar.gz"],
)


"@bazel/typescript": "^5.0.1",
  

Anything else relevant?

Metadata

Metadata

Assignees

No one assigned

    Labels

    Can Close?We will close this in 30 days if there is no further activity

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions