bazelbuild / rules_nodejs

NodeJS toolchain for Bazel.

Home Page:https://bazelbuild.github.io/rules_nodejs/

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Can't resolve 'babel-loader' when rules_nodejs switches from 3.0.0 to 5.7.1

herry-c opened this issue · comments

What happened?

I tried to switch my bazel project from bazel 4.1.0 to bazel 5.1.0 and upgrade the version of rules_nodejs from 3.0.0 to 5.7.1.
I noticed a change in the linked node_modules in the sandbox in the later version of rules_nodejs, and this change caused webpack to fail to parse'babble-loader'
The specific error is as follows:
Can't resolve 'babel-loader' in '/opt/bazel_cache/_bazel_root/3fef05b860e6929c9bbc774e44c8c249/sandbox/linux-sandbox/877/execroot/my_web'
My project is still in the root directory of the sandbox trying to find node_modules,How can I change my configuration to solve this parsing problem?

Version

Development (host) and target OS/architectures:
suse_x86
Output of bazel --version:
5.1.0

Version of rules_nodejs, or other relevant rules from your
WORKSPACE or MODULE.bazel file:
rules_nodejs 5.7.1
Language(s) and/or frameworks involved:

How to reproduce

This issue occurs when I upgrade the version of rules_nodejs from 3.0.0 to 5.7.1.

Any other information?

I tried to see the differences between different versions of rules_nodejs via --sandbox_debug
In version 3.0.0, the sandbox directory structure is as follows:
----- external
----- node_modules
----- bazel-out
----- my_project
--------- all.d.ts
--------- src
--------- tsconfig.json
--------- webpack.config.release.js
In version 5.7.1, the sandbox directory structure is as follows:
----- bazel-out
----- my_project
--------- all.d.ts
--------- node_modules
--------- src
--------- tsconfig.json
--------- webpack.config.release.js