Skip to content

Update interceptor.js - #128

Open
Simon Boddy (bbsimonbb) wants to merge 1 commit into
Azure:masterfrom
bbsimonbb:patch-1
Open

Update interceptor.js#128
Simon Boddy (bbsimonbb) wants to merge 1 commit into
Azure:masterfrom
bbsimonbb:patch-1

Conversation

@bbsimonbb

Copy link
Copy Markdown

Fixes the issue described here with the fix suggested in the answer.

Fixes the issue described [here](https://stackoverflow.com/questions/72407165/nodejs-error-using-import-with-iisnode)
with the fix suggested in the answer.
@ZachHaber

Copy link
Copy Markdown

It actually seems to work better if you use

import(require('url').pathToFileUrl(process.argv[1]));

From my experimentations with iisnode, if you use the child_process approach, then the logging seems to fail.

This one uses at least node 14 for the dynamic import, but anything less than node 14 likely wouldn't be using ESModules anyway.

@aklietz

Copy link
Copy Markdown
import(require('url').pathToFileUrl(process.argv[1]));

URL is all caps:

import(require('url').pathToFileURL(process.argv[1]));

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants