-
Notifications
You must be signed in to change notification settings - Fork 39
fix: removed support for experimental loader flag #2153
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
base: v5-release
Are you sure you want to change the base?
Changes from all commits
f9f068c
70826e1
bd4d8ff
4bdd095
ad59a6a
12d3113
40240f9
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change | ||||
|---|---|---|---|---|---|---|
|
|
@@ -5,18 +5,45 @@ | |||||
|
|
||||||
| 'use strict'; | ||||||
|
|
||||||
| const { isNodeJsTooOld, minimumNodeJsVersion } = require('@instana/core/src/util/nodeJsVersionCheck'); | ||||||
| const { esm, nodeJsVersionCheck } = require('@instana/core/src/util'); | ||||||
|
|
||||||
| if (isNodeJsTooOld()) { | ||||||
| if (nodeJsVersionCheck.isNodeJsTooOld()) { | ||||||
| // eslint-disable-next-line no-console | ||||||
| console.error( | ||||||
| `The package @instana/aws-fargate requires at least Node.js ${minimumNodeJsVersion} but this process is ` + | ||||||
| // eslint-disable-next-line max-len | ||||||
| `The package @instana/aws-fargate requires at least Node.js ${nodeJsVersionCheck.minimumNodeJsVersion} but this process is ` + | ||||||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. If a customer uses < 18.19 and the legacy esm loader, he will first run into this warning. Then he updates the node version, restarts and then he runs into the next warning. I am wondering if we should already link to the migration? 🤔 Because we currently only link to agents-aws-fargate#versioning. |
||||||
| `running on Node.js ${process.version}. This Fargate container will not be monitored by Instana.` + | ||||||
| 'See https://www.ibm.com/docs/en/instana-observability/current?topic=agents-aws-fargate#versioning.' | ||||||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
Is this still a valid link? 🤔
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Yeah it does, but somehow I cant follow we link there specifically 🤔 |
||||||
| ); | ||||||
| return; | ||||||
| } | ||||||
|
|
||||||
| // Check for unsupported ESM loader configurations and exit early | ||||||
| if (esm.hasExperimentalLoaderFlag()) { | ||||||
| // eslint-disable-next-line no-console | ||||||
| console.error( | ||||||
| "Node.js 18.19.0 and later no longer support the '--experimental-loader' flag for ESM. " + | ||||||
| `Your current version is ${process.version}. To ensure tracing by Instana, ` + | ||||||
| "please use the '--import' flag instead. For more information, refer to the Instana documentation: " + | ||||||
| 'https://www.ibm.com/docs/en/instana-observability/current?topic=nodejs-collector-installation.' | ||||||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Should we link to the upcoming v4->v5 migration guide? |
||||||
| ); | ||||||
| return; | ||||||
| } | ||||||
|
|
||||||
| // This loader worked with '--experimental-loader' in Node.js versions below 18.19. | ||||||
| // TODO: Remove 'esm-loader.mjs' file and this log in the next major release (v6). | ||||||
| if (esm.hasEsmLoaderFile()) { | ||||||
| // eslint-disable-next-line no-console | ||||||
| console.error( | ||||||
| "Importing 'esm-loader.mjs' is not supported and will be removed in next major release. " + | ||||||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
Suggested change
|
||||||
| 'This process will not be monitored by Instana. ' + | ||||||
| "Use 'esm-register.mjs' with '--import' to enable tracing. For more information, " + | ||||||
| 'refer to the Instana documentation: ' + | ||||||
| 'https://www.ibm.com/docs/en/instana-observability/current?topic=nodejs-collector-installation.' | ||||||
| ); | ||||||
| return; | ||||||
| } | ||||||
|
|
||||||
| const { util: coreUtil } = require('@instana/core'); | ||||||
| const { environment: environmentUtil, consoleLogger: serverlessLogger } = require('@instana/serverless'); | ||||||
|
|
||||||
|
|
||||||
Uh oh!
There was an error while loading. Please reload this page.