-
Notifications
You must be signed in to change notification settings - Fork 225
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
ESM instrumentation/hooking fails with Node.js v18.19.0 #3784
Labels
agent-nodejs
Make available for APM Agents project planning.
Comments
github-actions
bot
added
the
agent-nodejs
Make available for APM Agents project planning.
label
Dec 11, 2023
trentm
added a commit
that referenced
this issue
Dec 11, 2023
…ouble-import issue (#3783) In Nodejs v18.19.0 ESM module loading was moved to being off-thread (a backport from Node.js v20, nodejs/node#44710). This breaks current import-in-the-middle usage, resulting in ESM modules being double-loaded when the IITM hook is active (once on the loader worker thread, and then again later on the main thread). This change is a workaround to skip testing recent Node.js v18 versions until the IITM issue is resolved. Refs: #3784
workaround in ^^ |
IITM v1.6.0 was just released to fix this:
So I guess we could have just waited an hour. :) |
trentm
changed the title
test failing on node v18.19.0
ESM instrumentation/hooking fails with Node.js v18.19.0
Dec 11, 2023
trentm
added a commit
that referenced
this issue
Dec 11, 2023
[email protected] fixes an issue with double-importing with node 18.19.0 (due to a backport of ESM loading being done off main thread). Fixes: #3784
IITM fix in nodejs/import-in-the-middle#44 |
7 tasks
This was referenced Jan 11, 2024
trentm
added a commit
that referenced
this issue
Jan 11, 2024
…ouble-import issue (#3783) In Nodejs v18.19.0 ESM module loading was moved to being off-thread (a backport from Node.js v20, nodejs/node#44710). This breaks current import-in-the-middle usage, resulting in ESM modules being double-loaded when the IITM hook is active (once on the loader worker thread, and then again later on the main thread). This change is a workaround to skip testing recent Node.js v18 versions until the IITM issue is resolved. Refs: #3784
trentm
added a commit
that referenced
this issue
Jan 11, 2024
…ouble-import issue (#3824) (backport of #3783) In Nodejs v18.19.0 ESM module loading was moved to being off-thread (a backport from Node.js v20, nodejs/node#44710). This breaks current import-in-the-middle usage, resulting in ESM modules being double-loaded when the IITM hook is active (once on the loader worker thread, and then again later on the main thread). This change is a workaround to skip testing recent Node.js v18 versions until the IITM issue is resolved. Refs: #3784
fpm-peter
pushed a commit
to fpm-git/apm-agent-nodejs
that referenced
this issue
Aug 20, 2024
…ouble-import issue (elastic#3783) In Nodejs v18.19.0 ESM module loading was moved to being off-thread (a backport from Node.js v20, nodejs/node#44710). This breaks current import-in-the-middle usage, resulting in ESM modules being double-loaded when the IITM hook is active (once on the loader worker thread, and then again later on the main thread). This change is a workaround to skip testing recent Node.js v18 versions until the IITM issue is resolved. Refs: elastic#3784
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Out CI stated failing recently in the
test
action only for node v18 on a specific test scripttests/instrumentation/fixtures/use-knex-pg.mjs
.https://github.com/elastic/apm-agent-nodejs/actions/runs/7161350478/job/19496836227
The error reveals that the script is ran twice and a racing condition occurs when creating the database in
postgres
. The reason behind this double load seem to be a backport (from v20) of the loading process of modules.nodejs/node#44710
We can reproduce with a small project
You can see the module is loaded in the main and also in a worker thread
The text was updated successfully, but these errors were encountered: