-
-
Notifications
You must be signed in to change notification settings - Fork 1.1k
fix(cli): upgrade import-in-the-middle to v3.0.0 #3207
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
Changes from all commits
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 |
|---|---|---|
| @@ -0,0 +1,7 @@ | ||
| --- | ||
| "trigger.dev": patch | ||
| --- | ||
|
|
||
| Upgrade import-in-the-middle from 1.11.0 to 3.0.0 to fix the `importAssertions` deprecation warning on Node.js v21+, v20.10.0+, and v18.19.0+. | ||
|
|
||
| This resolves the error: `Use importAttributes instead of importAssertions` that occurred when using certain OpenTelemetry instrumentations like `UndiciInstrumentation`, `HttpInstrumentation`, and `AwsInstrumentation`. |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -114,7 +114,7 @@ | |
| "gradient-string": "^2.0.2", | ||
| "has-flag": "^5.0.1", | ||
| "ignore": "^7.0.5", | ||
| "import-in-the-middle": "1.11.0", | ||
| "import-in-the-middle": "3.0.0", | ||
|
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. 🧩 Analysis chain🏁 Script executed: #!/bin/bash
set -euo pipefail
# Verify the current loader integration still awaits the symbol instead of invoking it.
sed -n '1,120p' packages/cli-v3/src/entryPoints/loader.ts
rg -n "waitForAllMessagesAcknowledged" packages/cli-v3/src/entryPoints/loader.tsRepository: triggerdotdev/trigger.dev Length of output: 1009 Call The upgrade to Fix in
|
||
| "import-meta-resolve": "^4.1.0", | ||
| "ini": "^5.0.0", | ||
| "json-stable-stringify": "^1.3.0", | ||
|
|
||
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
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.
🚩 Dual versions of import-in-the-middle at runtime (3.0.0 and 1.11.0)
The pnpm-lock.yaml shows that
@opentelemetry/instrumentation@0.203.0still resolves its ownimport-in-the-middleto 1.11.0, while the CLI's direct dependency is now 3.0.0. At runtime in customer containers,loader.ts:2-4creates the hook message channel using v3.0.0'screateAddHookMessageChanneland registersimport-in-the-middle/hook.mjsfrom v3.0.0. Meanwhile,@opentelemetry/instrumentationuses its own v1.11.0 to calladdHookfor module interception. These two versions need compatible message channel protocols for the hooks to work. The v3.0.0 release was primarily about replacingimportAssertionswithimportAttributes(as stated in the changeset), and theHook/addHookAPI appears to be preserved. However, if the internal IPC protocol betweenhook.mjsand theHookclass changed across major versions, this could silently break OpenTelemetry instrumentation hooks. Worth verifying that the e2e tests pass end-to-end with instrumented packages (theotel-telemetry-loaderfixture tests this).Was this helpful? React with 👍 or 👎 to provide feedback.