Skip to content

Commit

Permalink
Attempt to add rollup as an optional dependency
Browse files Browse the repository at this point in the history
I tried both optionalDependencies and dependencies.

Doesn't work. Fails with the same error:

```
/private/var/tmp/_bazel_joe/1713d43747a35eb7e2009bc8fd9406b7/execroot/_main/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 (npm/cli#4828). Please try `npm i` again after removing both package-lock.json and node_modules directory.
    at requireWithFriendlyError (/private/var/tmp/_bazel_joe/1713d43747a35eb7e2009bc8fd9406b7/execroot/_main/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> (/private/var/tmp/_bazel_joe/1713d43747a35eb7e2009bc8fd9406b7/execroot/_main/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)
```
  • Loading branch information
jschaf committed Nov 7, 2024
1 parent 602c759 commit 824447e
Show file tree
Hide file tree
Showing 2 changed files with 22 additions and 2 deletions.
12 changes: 10 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,14 @@
"type": "module",
"packageManager": "[email protected]",
"pnpm": {
"onlyBuiltDependencies": []
"onlyBuiltDependencies": [],
"packageExtensions": {
"vite": {
"optionalDependencies": {
"@rollup/rollup-darwin-arm64": "4.24.4"
}
}
}
},
"version": "0.0.0",
"scripts": {
Expand All @@ -14,6 +21,7 @@
},
"devDependencies": {
"typescript": "~5.6.2",
"vite": "^5.4.9"
"vite": "^5.4.9",
"@rollup/rollup-darwin-arm64": "4.24.4"
}
}
12 changes: 12 additions & 0 deletions pnpm-lock.yaml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

0 comments on commit 824447e

Please sign in to comment.