Skip to content

getStringFromEnv is not a function in latest Sentry JS #17528

@Jimmy89

Description

@Jimmy89

Is there an existing issue for this?

How do you use Sentry?

Sentry Saas (sentry.io)

Which SDK are you using?

@sentry/aws-serverless

SDK Version

10.9.0

Framework Version

NodeJS 22 (AWS Lambda)

Link to Sentry event

https://basisbeeld.sentry.io/issues/61768671/
More specific seems this report: https://basisbeeld.sentry.io/issues/61768643/

Reproduction Example/SDK Setup

Instrument.mjs

import * as Sentry from "@sentry/aws-serverless";
import { nodeProfilingIntegration } from "@sentry/profiling-node";
import { extraErrorDataIntegration } from "@sentry/node";

Sentry.init({ // <-- This triggers the error
  integrations: [
    nodeProfilingIntegration(),
    extraErrorDataIntegration({ depth: 5 }),
  ],
  tracesSampleRate: 0,
  profilesSampleRate: 0,
  attachStacktrace: true,
  enabled: true,
});

export default Sentry;

Package.json

  "dependencies": {
    "@sentry/aws-serverless": "10.9.0",
    "@sentry/profiling-node": "10.9.0"
  },

index.mjs

export const handler = Sentry.wrapHandler(async (event = {}, context = {}) => {
  // Code
}, { startTrace: false });

Error:
(0 , core_1.getStringFromEnv) is not a function

Going back to version 9.46.0 resolves the issue.

I also get this stack trace in a second issue:

class HttpInstrumentation extends instrumentation_1.InstrumentationBase {
    /** keep track on spans not ended */
    _spanNotEnded = new WeakSet();
    _headerCapture;
    _semconvStability = instrumentation_1.SemconvStability.OLD; // <-- Cannot read properties of undefined (reading 'OLD')

Steps to Reproduce

  1. Run a hello world in a AWS Lambda NodeJS v22 with the settings above.
  2. Invoke the lambda

Expected Result

That the code actually runs without Sentry crashing ;)

Actual Result

We cannot run code as Sentry crashes.

Metadata

Metadata

Assignees

No one assigned

    Projects

    Status

    Waiting for: Community

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions