Open losh11 opened 8 months ago
Based on the output of the command, even though you are running bun run
, the script is using node
. What if you try bun --bun run build
?
Reproduced independently.
me@minimind:~/src/cmet/discord-bot$ bun run --bun gen
$ pbts -o src/.generated/gtfs.d.ts src/.generated/gtfs.js
7 | */
8 | const _ = require('lodash');
9 | const fs = require('fs');
10 | const Module = require('module');
11 |
12 | const originalWrapper = Module.wrapper.slice(0);
^
TypeError: undefined is not an object (evaluating 'Module.wrapper.slice')
at //discord-bot/node_modules/requizzle/lib/loader.js:12:32
at //discord-bot/node_modules/requizzle/lib/requizzle.js:10:7
at //discord-bot/node_modules/requizzle/index.js:8:7
at //discord-bot/node_modules/jsdoc/jsdoc.js:17:5
at //discord-bot/node_modules/jsdoc/jsdoc.js:34:36
Bun v1.1.17 (Linux x64)
121 | try { cleanup.forEach(fs.unlinkSync); } catch(e) {/**/} cleanup = [];
122 |
123 | if (code) {
124 | out = out.join("").replace(/\s*JSDoc \d+\.\d+\.\d+ [^$]+/, "");
125 | process.stderr.write(out);
126 | var err = Error("code " + code);
^
error: code 1
at //discord-bot/node_modules/protobufjs-cli/pbts.js:126:27
at emit (node:events:180:48)
at #maybeClose (node:child_process:809:14)
at #handleOnExit (node:child_process:591:16)
Bun v1.1.17 (Linux x64)
error: script "gen" exited with code 1
No error if I omit the --bun flag.
Thank you!
https://github.com/carrismetropolitana/discord-bot Can reproduce here. Had to add a node install to my Dockerfile to actually bundle stuff properly.
Try to run bun run --bun gen
.
What version of Bun is running?
1.0.31+e25675121
What platform is your computer?
Darwin 23.2.0 x86_64 i386
What steps can reproduce the bug?
My library has a build command which previously worked when doing
npm run build
. This build command runs another command callsbun run protobuf
, this command in return runs another commands which usespbjs
to generate js from a .proto file.package.json
What is the expected behavior?
Changing from
npm
->bun
in the build scripts fails to run with error below. However previously when build scripts usenpm
, runningbun run build
worked as expected.What do you see instead?
Additional information
Weirdly, running the
bun run build
script after it first errors, seems to work as expected.