-
Notifications
You must be signed in to change notification settings - Fork 36
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
fix: resolved esm loader issue for manual instrumentation node v18.19.0 and above #1063
Merged
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
aryamohanan
force-pushed
the
fix-esm-loader
branch
4 times, most recently
from
March 8, 2024 12:40
4da6bbe
to
4b83d46
Compare
aryamohanan
force-pushed
the
fix-esm-loader
branch
from
March 13, 2024 08:56
4b83d46
to
c9fa51d
Compare
aryamohanan
force-pushed
the
fix-esm-loader
branch
2 times, most recently
from
March 20, 2024 05:24
faa88a9
to
722f0a6
Compare
aryamohanan
force-pushed
the
fix-esm-loader
branch
from
March 26, 2024 16:58
af5156c
to
1b882ce
Compare
aryamohanan
force-pushed
the
fix-esm-loader
branch
2 times, most recently
from
April 2, 2024 15:15
029c460
to
d4c4d23
Compare
kirrg001
requested changes
Apr 3, 2024
aryamohanan
force-pushed
the
fix-esm-loader
branch
from
April 4, 2024 15:33
32b8402
to
d583209
Compare
aryamohanan
force-pushed
the
fix-esm-loader
branch
from
April 4, 2024 15:48
d583209
to
f84b8d4
Compare
kirrg001
requested changes
Apr 5, 2024
aryamohanan
changed the title
fix: fixed esm loader issue for node v18.19.0 and above
fix: fixed esm loader issue for manual instrumentation node v18.19.0 and above
Apr 9, 2024
aryamohanan
force-pushed
the
fix-esm-loader
branch
3 times, most recently
from
April 10, 2024 10:13
83e46b5
to
198c762
Compare
kirrg001
requested changes
Apr 10, 2024
packages/collector/test/tracing/sdk/multiple_installations/esm/src/register.mjs
Outdated
Show resolved
Hide resolved
Question: the PR pipeline runs with Node 18.18. How do we know that the tests are green for aws-fargate & 18.19? |
aryamohanan
force-pushed
the
fix-esm-loader
branch
from
April 10, 2024 11:44
4e2ca32
to
1956bdc
Compare
Tested with v20 in a seprate pipeline, thanks again for pointing this ❤️ |
kirrg001
reviewed
Apr 10, 2024
aryamohanan
changed the title
fix: fixed esm loader issue for manual instrumentation node v18.19.0 and above
fix: resolved esm loader issue for manual instrumentation node v18.19.0 and above
Apr 10, 2024
kirrg001
approved these changes
Apr 10, 2024
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Great work 👹
4 tasks
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Starting from version 20.6, ESM loaders are off-threaded, loaded in separate thread, whereas previously we were loading our Instana collector in loader, so the change broke existing implementation. To resolve this, we used the
--import
flag, replacing the deprecated--experimental-loader
and allowing the collector to load within the main thread.Note that --import is supported only in Node.js versions 18.19 and later. Thus, we maintain both loading styles for compatibility across different Node.js versions.
To enable experimental ESM support, use the following command:
For Node.js versions greater than or equal to 18.19:
node --import /path/to/instana/node_modules/@instana/collector/esm-register.mjs entry-point
For Node.js versions less than 18.19:
node --experimental-loader /path/to/instana/node_modules/@instana/collector/esm-loader.mjs entry-point
We're actively working on implementing native ESM support, targeted for resolution in INSTA-807.
References:
Move ESM loaders off-thread
nodejs/node#47880
Notes:
--import
flag is still on experimental phase.Tasks
Post Release