-
Notifications
You must be signed in to change notification settings - Fork 20
New issue
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
do not error when processing sources that include node hashbang #217
Conversation
@tommy-mitchell thank you for giving esmock your valuable attention. Feel free to leave any comments or advice. This PR builds on the test from your earlier PR |
this test is failing in windows and maybe a different PR should resolve it. It relates to filesystem paths
|
the win32 could probably be resolved soon, but slow internet speeds here make it difficult to setup a windows virtual machine to run tests with latest node 18 |
I have a Windows x64 machine, would that work for reproducing? I could try resolving it |
@tommy-mitchell that would be great. Here is where I think the problem is. I think import.meta.resolve is returning the path n the wrong format const resolve = isMetaResolve ?
(import.meta.resolve.constructor.name === 'AsyncFunction'
? async (id, p) => import.meta.resolve(id, asFileURL(p))
.catch(() => resolvewith(id, p))
: (id, p) => {
try { return import.meta.resolve(id, asFileURL(p)) }
catch { return resolvewith(id, p) }
})
: resolvewith cd into the tests-source-map folder and |
possibly related nodejs/node#35518 ![]() |
Pinning the node version number to 18.16 resolved the pipeline error. A ticket for that node 18.17 issue is created here nodejs/node#48948 and so this PR for hashbang support is complete and ready for review |
if anyone has retro-active review comments feel free to leave those |
cc @koshic @tommy-mitchell re #215
this PR removes the hashbang line from the sources before prepending import expressions, then re-adds any hashbang line to the final result returned by the loader