-
Notifications
You must be signed in to change notification settings - Fork 239
Closed
Labels
agent-nodejsMake available for APM Agents project planning.Make available for APM Agents project planning.communityimpact:highShort-term priority; add to current release, or definitely next.Short-term priority; add to current release, or definitely next.
Description
Describe the bug
Background context:
- PR chore(deps): bump @elastic/ecs-pino-format from 1.4.0 to 1.5.0 #3708 auto-bumped the dependency of
@elastic/ecs-pino-formatfrom1.4.0to1.5.0. 1.5.0added a new namedecsFormatexport as the preferred API.- chore(deps): bump @elastic/ecs-pino-format from 1.4.0 to 1.5.0 #3708 got an additional commit that used the named export instead of the old default export.
- This was released in
elastic-apm-nodev4.2.0(but wasn't mentioned in the changelog).
The problem:
- Unfortunately, chore(deps): bump @elastic/ecs-pino-format from 1.4.0 to 1.5.0 #3708 only bumped
package-lock.jsonbut leftpackage.jsonalone, so it still publishes a dependency on"@elastic/ecs-pino-format": "^1.4.0" - Some projects can update to
elastic-apm-node@4.2.0but still use@elastic/ecs-pino-format@1.4.0, especially when package lockfiles are taken into account. - Using this combination means
const { ecsFormat } = require('@elastic/ecs-pino-format')returnsundefined, then later throwsTypeError: ecsFormat is not a function
To Reproduce
Presumably, running npm install @elastic/ecs-pino-format@1.4.0 in this repo then running the tests should show the error.
I can't tell for certain because trying to run this repo's tests on my M2 mac failed to pull some Docker images.
Expected behavior
Changing the package.json minimum dependency to ^1.5.0 should fix the error.
How are you starting the agent? (please tick one of the boxes)
- Calling
agent.start()directly (e.g.require('elastic-apm-node').start(...)) - Requiring
elastic-apm-node/startfrom within the source code - Starting node with
-r elastic-apm-node/start
Additional context
I would have quickly raised a PR for this, but I couldn't run the tests. (Also, a single-character PR isn't worth the hoops I'd have to jump through to sign the corporate CLA, unfortunately.)
alexframe
Metadata
Metadata
Assignees
Labels
agent-nodejsMake available for APM Agents project planning.Make available for APM Agents project planning.communityimpact:highShort-term priority; add to current release, or definitely next.Short-term priority; add to current release, or definitely next.