Can't --require/--import when using --env-file
alexgagnon opened this issue · 1 comments
alexgagnon commented
Acknowledgements
- I read the documentation and searched existing issues to avoid duplicates
- I understand this is a bug tracker and anything other than a proven bug will be closed
- I understand this is a free project and relies on community contributions
- I read and understood the Contribution guide
Minimal reproduction URL
https://stackblitz.com/edit/node-lvmb18?file=fetch.ts,package.json,.env
Problem & expected behavior (under 200 words)
The minimal repro uses Node v18, in Node v22 using --import instead of --require it also fails, but with "ERR_UNKNOWN_FILE_EXTENSION"
Bugs are expected to be fixed by those affected by it
- I'm interested in working on this issue
Compensating engineering work will speed up resolution and support the project
- I'm willing to offer $10 for financial support
privatenumber commented
It's behaving exactly like Node. Try converting the files to .js
and run:
node --env-file .env --require ./fetch.js ./index.js
Consider filing your report with Node instead.