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

[Bug]: Unable to run Vite #2005

Open
jschaf opened this issue Oct 30, 2024 · 0 comments
Open

[Bug]: Unable to run Vite #2005

jschaf opened this issue Oct 30, 2024 · 0 comments
Labels
bug Something isn't working

Comments

@jschaf
Copy link

jschaf commented Oct 30, 2024

What happened?

Reproduction repo: https://github.com/jschaf/bazel-rules-js-vite

Version

Development (host) and target OS/architectures:

Output of bazel --version: bazel 7.4.0

Version of the Aspect rules, or other relevant rules from your
WORKSPACE or MODULE.bazel file:

bazel_dep(name = "aspect_bazel_lib", version = "2.7.7")
bazel_dep(name = "aspect_rules_js", version = "2.1.0")
bazel_dep(name = "aspect_rules_swc", version = "2.0.1")
bazel_dep(name = "aspect_rules_ts", version = "3.2.1")
bazel_dep(name = "bazel_skylib", version = "1.6.1")
bazel_dep(name = "rules_nodejs", version = "6.3.1")

Language(s) and/or frameworks involved:

JavaScript and TypeScript

How to reproduce

git clone https://github.com/jschaf/bazel-rules-js-vite
cd bazel-rules-js-vite
bazelisk run //:vite -- --help

Any other information?

The main differences that I noticed from the example repos are:

  1. This repo uses pnpm lock version 9.0
  2. Running Vite in the same directory as the node_modules.

Here's the failing stack trace.

$BAZEL_OUT/darwin_arm64-fastbuild/bin/vite_/vite.runfiles/_main/node_modules/.aspect_rules_js/[email protected]/node_modules/rollup/dist/native.js:63
                throw new Error(
                      ^

Error: Cannot find module @rollup/rollup-darwin-arm64. npm has a bug related to optional dependencies (https://github.com/npm/cli/issues/4828). Please try `npm i` again after removing both package-lock.json and node_modules directory.
    at requireWithFriendlyError ($BAZEL_OUT/darwin_arm64-fastbuild/bin/vite_/vite.runfiles/_main/node_modules/.aspect_rules_js/[email protected]/node_modules/rollup/dist/native.js:63:9)
    at Object.<anonymous> ($BAZEL_OUT/darwin_arm64-fastbuild/bin/vite_/vite.runfiles/_main/node_modules/.aspect_rules_js/[email protected]/node_modules/rollup/dist/native.js:72:76)
    ... 3 lines matching cause stack trace ...
    at Module._load (node:internal/modules/cjs/loader:1104:12)
    at cjsLoader (node:internal/modules/esm/translators:346:17)
    at ModuleWrap.<anonymous> (node:internal/modules/esm/translators:286:7)
    at ModuleJob.run (node:internal/modules/esm/module_job:234:25)
    at async ModuleLoader.import (node:internal/modules/esm/loader:473:24) {
  [cause]: Error: Cannot find module '@rollup/rollup-darwin-arm64'
@jschaf jschaf added the bug Something isn't working label Oct 30, 2024
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

1 participant