import.meta.resolve
is broken in vite-node, despite working in node
#6953
Labels
import.meta.resolve
is broken in vite-node, despite working in node
#6953
Describe the bug
Given an
index.mjs
file with the following line of code:It works properly when running
node index.mjs
, but throws an error when running in vite-nodenpx vite-node index.mjs
:TypeError: __vite_ssr_import_meta__.resolve is not a function
Reproduction
mkdir repro && cd $_
echo 'console.log(import.meta.resolve("./index.mjs"));' > index.mjs
node index.mjs
will printfile://.../repro/index.mjs
npx vite-node index.mjs
will printSystem Info
Used Package Manager
npm
Validations
The text was updated successfully, but these errors were encountered: