Skip to content
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

Tracking issue for suspected node bug in loader chaining #1774

Closed
cspotcode opened this issue May 26, 2022 · 0 comments
Closed

Tracking issue for suspected node bug in loader chaining #1774

cspotcode opened this issue May 26, 2022 · 0 comments

Comments

@cspotcode
Copy link
Collaborator

cspotcode commented May 26, 2022

Our nightly tests flagged a bug in loader chaining.

nodejs/node#43238


mts files are being transformed twice. Looks like node is calling our load hook twice.

nightly build that passes
https://nodejs.org/download/nightly/v19.0.0-nightly2022052340fa2e9c11/node-v19.0.0-nightly2022052340fa2e9c11-linux-x64.tar.xz
nightly build that fails
https://nodejs.org/download/nightly/v19.0.0-nightly202205249a3326f332/node-v19.0.0-nightly202205249a3326f332-linux-x64.tar.xz

nightly tests passing:
https://github.com/TypeStrong/ts-node/runs/6565029160?check_suite_focus=true
failing:
https://github.com/TypeStrong/ts-node/runs/6583820299?check_suite_focus=true

code changes:
nodejs/node@40fa2e9...9a3326f

captured stack traces of the 2x compilations of a single file.

trace: 'Error\n' +
    '    at Object.compile (/d/Personal-dev/@TypeStrong/ts-node/fix-tests/tests/node_modules/ts-node/src/index.ts:1401:59)\n' +
    '    at transformSource (/d/Personal-dev/@TypeStrong/ts-node/fix-tests/tests/node_modules/ts-node/src/esm.ts:400:37)\n' +
    '    at /d/Personal-dev/@TypeStrong/ts-node/fix-tests/tests/node_modules/ts-node/src/esm.ts:278:53\n' +
    '    at async addShortCircuitFlag (/d/Personal-dev/@TypeStrong/ts-node/fix-tests/tests/node_modules/ts-node/src/esm.ts:409:15)\n' +
    '    at async nextLoad (node:internal/modules/esm/loader:564:22)\n' +
    '    at async /d/Personal-dev/@TypeStrong/ts-node/fix-tests/tests/node_modules/ts-node/src/esm.ts:255:39\n' +
    '    at async addShortCircuitFlag (/d/Personal-dev/@TypeStrong/ts-node/fix-tests/tests/node_modules/ts-node/src/esm.ts:409:15)\n' +
    '    at async ESMLoader.load (node:internal/modules/esm/loader:571:20)\n' +
    '    at async ESMLoader.moduleProvider (node:internal/modules/esm/loader:422:11)\n' +
    '    at async link (node:internal/modules/esm/module_job:70:21)'

trace: 'Error\n' +
    '    at Object.compile (/d/Personal-dev/@TypeStrong/ts-node/fix-tests/tests/node_modules/ts-node/src/index.ts:1401:59)\n' +
    '    at transformSource (/d/Personal-dev/@TypeStrong/ts-node/fix-tests/tests/node_modules/ts-node/src/esm.ts:400:37)\n' +
    '    at /d/Personal-dev/@TypeStrong/ts-node/fix-tests/tests/node_modules/ts-node/src/esm.ts:278:53\n' +
    '    at async addShortCircuitFlag (/d/Personal-dev/@TypeStrong/ts-node/fix-tests/tests/node_modules/ts-node/src/esm.ts:409:15)\n' +
    '    at async ESMLoader.load (node:internal/modules/esm/loader:571:20)\n' +
    '    at async ESMLoader.moduleProvider (node:internal/modules/esm/loader:422:11)\n' +
    '    at async link (node:internal/modules/esm/module_job:70:21)'

Looking closely we can see that, when we call nextLoad, node is calling right back into us.

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

No branches or pull requests

1 participant