You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
$ bun run test.mjs
dir: /home/ubuntu
dirname: undefined
file: test.mjs
filename: undefined
Additional information
Since Node.js v21.2.0, import.meta.dirname and import.meta.filename are added. nodejs/node#48740
import.meta.dirname can be added to Bun as an alias for import.meta.dir.
However, while import.meta.filename in Node.js includes the directory but import.meta.file in Bun does not, import.meta.filename would not be just an alias. import.meta.filename equals ${import.meta.dir}/${import.meta.file}.
I think the behavior might cause some confusion, but I believe that adding these properties would improve compatibility with Node.js.
What version of Bun is running?
1.0.18+36c316a24
What platform is your computer?
Linux 5.15.0-1048-oracle aarch64 aarch64
What steps can reproduce the bug?
What is the expected behavior?
What do you see instead?
Additional information
Since Node.js v21.2.0,
import.meta.dirname
andimport.meta.filename
are added. nodejs/node#48740import.meta.dirname
can be added to Bun as an alias forimport.meta.dir
.However, while
import.meta.filename
in Node.js includes the directory butimport.meta.file
in Bun does not,import.meta.filename
would not be just an alias.import.meta.filename
equals${import.meta.dir}/${import.meta.file}
.I think the behavior might cause some confusion, but I believe that adding these properties would improve compatibility with Node.js.
Node.js docs: https://nodejs.org/api/esm.html#importmeta
Bun docs: https://bun.sh/docs/api/import-meta
The text was updated successfully, but these errors were encountered: