We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
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
parent-module - npm - github
0.8.1+16b4bf341acc0f4804f0b6bdf5298c180cd00366
Darwin 22.5.0 arm64 arm
Example from https://www.npmjs.com/package/parent-module :
// bar.js import parentModule from 'parent-module'; export default function bar() { console.log(parentModule()); //=> '/Users/<myyser>/<path>/foo.js' }; // foo.js import bar from './bar.js'; bar();
bun foo.js
That it doesn't break and prints the foo.js path:
/Users/<myyser>/<path>/foo.js
➜ bun foo.js 2 | 3 | export default function parentModule(filePath) { 4 | const stacks = callsites(); 5 | 6 | if (!filePath) { 7 | return stacks[2].getFileName(); ^ TypeError: undefined is not an object (evaluating 'stacks[2].getFileName') at parentModule (/Users/admin/repos/bun-parent-module-test/node_modules/parent-module/index.js:7:9) at bar (/Users/admin/repos/bun-parent-module-test/bar.ts:4:13) at /Users/admin/repos/bun-parent-module-test/foo.ts:3:0
Blocks:
The text was updated successfully, but these errors were encountered:
Error.prepareStackTrace
new Error().stack
Fixed in #5802
This will be released in Bun v1.0.3.
If you don't want to wait until then, an hour after this comment was written you should be able to upgrade to the canary build of Bun:
bun upgrade --canary
Sorry, something went wrong.
No branches or pull requests
parent-module - npm - github
What version of Bun is running?
0.8.1+16b4bf341acc0f4804f0b6bdf5298c180cd00366
What platform is your computer?
Darwin 22.5.0 arm64 arm
What steps can reproduce the bug?
Example from https://www.npmjs.com/package/parent-module :
bun foo.js
What is the expected behavior?
That it doesn't break and prints the foo.js path:
/Users/<myyser>/<path>/foo.js
What do you see instead?
Additional information
Blocks:
The text was updated successfully, but these errors were encountered: