Skip to content
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

Sentry.captureException is not a function #7441

Closed
3 tasks done
maxpain opened this issue Mar 13, 2023 · 26 comments · Fixed by #7457
Closed
3 tasks done

Sentry.captureException is not a function #7441

maxpain opened this issue Mar 13, 2023 · 26 comments · Fixed by #7457
Assignees
Labels
Package: serverless Issues related to the Sentry Serverless SDK Type: Bug

Comments

@maxpain
Copy link

maxpain commented Mar 13, 2023

Is there an existing issue for this?

How do you use Sentry?

Self-hosted/on-premise

Which SDK are you using? If you use the CDN bundles, please specify the exact bundle (e.g. bundle.tracing.min.js) in your SDK setup.

@sentry/serverless

SDK Version

7.43.0

Framework Version

No response

Link to Sentry event

No response

SDK Setup

import * as Sentry from '@sentry/serverless'

Sentry.GCPFunction.init({
	dsn: '',
	environment: process.env.NODE_ENV,
})

Steps to Reproduce

Sentry.captureException(new Error('test'))

Expected Result

Don't crash

Actual Result

Crash

TypeError: Sentry.captureException is not a function
    at file:///Users/maxpain/dev/gptaskbot/src/index.ts:64:8
    at processTicksAndRejections (node:internal/process/task_queues:95:5)
@AbhiPrasad
Copy link
Member

Hey @maxpain thanks for writing in!

As per https://unpkg.com/@sentry/serverless@7.42.0/cjs/index.js we should be exporting Sentry.captureException.

Did this start happening with the latest version? Are you using some bundling process when deploying to your serverless function?

@maxpain
Copy link
Author

maxpain commented Mar 13, 2023

Hey @maxpain thanks for writing in!

As per https://unpkg.com/@sentry/serverless@7.42.0/cjs/index.js we should be exporting Sentry.captureException.

Did this start happening with the latest version? Are you using some bundling process when deploying to your serverless function?

Hello. I don't know, I just switched from @sentry/node to @sentry/serverless in my Google Cloud Function

@AbhiPrasad AbhiPrasad added Status: Needs Reproduction Package: serverless Issues related to the Sentry Serverless SDK labels Mar 13, 2023
@AbhiPrasad
Copy link
Member

What happens if you import via a require call? I'm unable to reproduce this unfortunately.

Our serverless SDK just re-exports the Node SDK:

export * from '@sentry/node';

What happens if you explicitly import captureException and use it?

const { captureException } = require('@sentry/serverless');

Are you able to provide a reproduction of some kind to help us debug further?

@maxpain
Copy link
Author

maxpain commented Mar 13, 2023

@AbhiPrasad

const { captureException } = require('@sentry/serverless')
captureException(new Error('test'))
maxpain@Maksims-MacBook-Pro-2 webhooks % npx env-cmd ts-node --esm ./src/handle-gamemoney.ts
ReferenceError: require is not defined in ES module scope, you can use import instead
    at file:///Users/maxpain/dev/gptask/webhooks/src/handle-gamemoney.ts:1:30
    at ModuleJob.run (node:internal/modules/esm/module_job:193:25)

@AbhiPrasad
Copy link
Member

maxpain@Maksims-MacBook-Pro-2 webhooks % npx env-cmd ts-node --esm ./src/handle-gamemoney.ts
ReferenceError: require is not defined in ES module scope, you can use import instead
    at file:///Users/maxpain/dev/gptask/webhooks/src/handle-gamemoney.ts:1:30
    at ModuleJob.run (node:internal/modules/esm/module_job:193:25)

This error makes sense, since you were calling ts-node with the --esm flag, which means that require does not work.

I tried reproducing this here: https://github.com/AbhiPrasad/GH-7441-captureException-not-a-function, but works fine for me. Are you sure you've installed your packages correctly?

@maxpain
Copy link
Author

maxpain commented Mar 14, 2023

@AbhiPrasad Adding "type": "module" to package.json, which makes this package an ESM module, causes the error.

@AbhiPrasad
Copy link
Member

Ah yeah I forgot to remove the require call:

diff --git a/src/handle-gamemoney.ts b/src/handle-gamemoney.ts
index 4545802..b6db55e 100644
--- a/src/handle-gamemoney.ts
+++ b/src/handle-gamemoney.ts
@@ -1,2 +1,2 @@
-const { captureException } = require("@sentry/serverless");
+import { captureException } from "@sentry/serverless";
 captureException(new Error("test"));

Now we should be using esm across the board! Running npx env-cmd ts-node --esm ./src/handle-gamemoney.ts seems to be fine! I don't get TypeError: Sentry.captureException is not a function.

@maxpain
Copy link
Author

maxpain commented Mar 14, 2023

@AbhiPrasad
Copy link
Member

Thanks, was able to reproduce! I don't quite understand why this is happening though because we ship esm:

"module": "build/npm/esm/index.js",

For some reason, ts-node is falling back to using commonjs.

The work around is like so

src/index.ts

import Sentry from "@sentry/serverless";
Sentry.captureException(new Error("test"));

@maxpain
Copy link
Author

maxpain commented Mar 14, 2023

For some reason, ts-node is falling back to using commonjs.

No, the problem is not in ts-node.

maxpain@Maksims-MacBook-Pro-2 GH-7441-captureException-not-a-function % npx tsc
maxpain@Maksims-MacBook-Pro-2 GH-7441-captureException-not-a-function % node .build/index.js
file:///Users/maxpain/dev/GH-7441-captureException-not-a-function/.build/index.js:2
Sentry.captureException(new Error("test"));
       ^

TypeError: Sentry.captureException is not a function
    at file:///Users/maxpain/dev/GH-7441-captureException-not-a-function/.build/index.js:2:8
    at ModuleJob.run (node:internal/modules/esm/module_job:193:25)

Node.js v19.7.0

@maxpain
Copy link
Author

maxpain commented Mar 14, 2023

By the way, this approach also doesn't work:

import { captureException } from "@sentry/serverless";
captureException(new Error("test"));
maxpain@Maksims-MacBook-Pro-2 GH-7441-captureException-not-a-function % npx ts-node --esm src/index.ts
file:///Users/maxpain/dev/GH-7441-captureException-not-a-function/src/index.ts:1
import { captureException } from "@sentry/serverless";
         ^^^^^^^^^^^^^^^^
SyntaxError: Named export 'captureException' not found. The requested module '@sentry/serverless' is a CommonJS module, which may not support all module.exports as named exports.
CommonJS modules can always be imported via the default export, for example using:

import pkg from '@sentry/serverless';
const { captureException } = pkg;

    at ModuleJob._instantiate (node:internal/modules/esm/module_job:123:21)
    at async ModuleJob.run (node:internal/modules/esm/module_job:189:5)

@AbhiPrasad
Copy link
Member

yes the thing is with your tsconfig setup in general - which is detailed in TypeStrong/ts-node#935

The problem is that I guess the newest node versions expect *.mjs or type: "module" to be set in package.json, but we can't do this because it'll break those with old node versions, so we are stuck in a hard place here.

We expose esm -https://unpkg.com/@sentry/serverless@7.43.0/esm/index.js, but I guess typescript is not respecting that and expecting something else :/

@maxpain
Copy link
Author

maxpain commented Mar 14, 2023

But I don't have any problems with @sentry/node.

@AbhiPrasad
Copy link
Member

AbhiPrasad commented Mar 14, 2023

Ah I see what the issue is now! We might be incorrectly setting the package.json main/module! What do you see when you look at package.json under @sentry/serverless in the node_modules folder?

@maxpain
Copy link
Author

maxpain commented Mar 14, 2023

Ah I see what the issue is now! We might be incorrectly setting the package.json main/module! What do you see when you look at package.json under @sentry/serverless in the node_modules folder?

@sentry/serverless

image

@maxpain
Copy link
Author

maxpain commented Mar 14, 2023

@sentry/node

image

@maxpain
Copy link
Author

maxpain commented Mar 14, 2023

Basically, everything is the same except for "engines.node" field.

@AbhiPrasad
Copy link
Member

I wonder if the usage of the namespace imports is causing issues:

import * as AWSLambda from './awslambda';
import * as GCPFunction from './gcpfunction';
export { AWSLambda, GCPFunction };

@AbhiPrasad
Copy link
Member

It is causing issues! It's causing the node exports to go under default

[Module: null prototype] {
  AWSLambda: {
    defaultIntegrations: [
      [InboundFilters],
      [FunctionToString],
      [Console],
      [Http],
      [OnUncaughtException],
      [OnUnhandledRejection],
      [ContextLines],
      [LocalVariables],
      [Context],
      [Modules],
      [RequestData],
      [LinkedErrors],
      [AWSServices]
    ],
    init: [Function: init],
    tryPatchHandler: [Function: tryPatchHandler],
    wrapHandler: [Function: wrapHandler],
    Hub: [class Hub],
    SDK_VERSION: '7.43.0',
    Scope: [class Scope],
    addBreadcrumb: [Function: addBreadcrumb],
    addGlobalEventProcessor: [Function: addGlobalEventProcessor],
    captureEvent: [Function: captureEvent],
    captureException: [Function: captureException],
    captureMessage: [Function: captureMessage],
    configureScope: [Function: configureScope],
    createTransport: [Function: createTransport],
    getCurrentHub: [Function: getCurrentHub],
    getHubFromCarrier: [Function: getHubFromCarrier],
    makeMain: [Function: makeMain],
    setContext: [Function: setContext],
    setExtra: [Function: setExtra],
    setExtras: [Function: setExtras],
    setTag: [Function: setTag],
    setTags: [Function: setTags],
    setUser: [Function: setUser],
    startTransaction: [Function: startTransaction],
    withScope: [Function: withScope],
    NodeClient: [class NodeClient extends BaseClient],
    makeNodeTransport: [Function: makeNodeTransport],
    close: [AsyncFunction: close],
    defaultStackParser: [Function (anonymous)],
    flush: [AsyncFunction: flush],
    getSentryRelease: [Function: getSentryRelease],
    lastEventId: [Function: lastEventId],
    DEFAULT_USER_INCLUDES: [ 'id', 'username', 'email' ],
    addRequestDataToEvent: [Function: addRequestDataToEvent],
    extractRequestData: [Function: extractRequestData],
    deepReadDirSync: [Function: deepReadDirSync],
    Handlers: {
      extractRequestData: [Function: extractRequestData],
      parseRequest: [Function: parseRequest],
      errorHandler: [Function: errorHandler],
      requestHandler: [Function: requestHandler],
      tracingHandler: [Function: tracingHandler]
    },
    Integrations: {
      FunctionToString: [Function],
      InboundFilters: [Function],
      Console: [Function],
      Http: [Function],
      OnUncaughtException: [Function],
      OnUnhandledRejection: [Function],
      LinkedErrors: [Function],
      Modules: [Function],
      ContextLines: [Function],
      Context: [Function],
      RequestData: [Function],
      LocalVariables: [Function]
    }
  },
  AWSServices: [class AWSServices] { id: 'AWSServices' },
  GCPFunction: {
    wrapHttpFunction: [Function: wrapHttpFunction],
    wrapEventFunction: [Function: wrapEventFunction],
    wrapCloudEventFunction: [Function: wrapCloudEventFunction],
    defaultIntegrations: [
      [InboundFilters],
      [FunctionToString],
      [Console],
      [Http],
      [OnUncaughtException],
      [OnUnhandledRejection],
      [ContextLines],
      [LocalVariables],
      [Context],
      [Modules],
      [RequestData],
      [LinkedErrors],
      [GoogleCloudHttp],
      [GoogleCloudGrpc]
    ],
    init: [Function: init]
  },
  __esModule: true,
  default: {
    AWSLambda: {
      defaultIntegrations: [Array],
      init: [Function: init],
      tryPatchHandler: [Function: tryPatchHandler],
      wrapHandler: [Function: wrapHandler],
      Hub: [class Hub],
      SDK_VERSION: '7.43.0',
      Scope: [class Scope],
      addBreadcrumb: [Function: addBreadcrumb],
      addGlobalEventProcessor: [Function: addGlobalEventProcessor],
      captureEvent: [Function: captureEvent],
      captureException: [Function: captureException],
      captureMessage: [Function: captureMessage],
      configureScope: [Function: configureScope],
      createTransport: [Function: createTransport],
      getCurrentHub: [Function: getCurrentHub],
      getHubFromCarrier: [Function: getHubFromCarrier],
      makeMain: [Function: makeMain],
      setContext: [Function: setContext],
      setExtra: [Function: setExtra],
      setExtras: [Function: setExtras],
      setTag: [Function: setTag],
      setTags: [Function: setTags],
      setUser: [Function: setUser],
      startTransaction: [Function: startTransaction],
      withScope: [Function: withScope],
      NodeClient: [class NodeClient extends BaseClient],
      makeNodeTransport: [Function: makeNodeTransport],
      close: [AsyncFunction: close],
      defaultStackParser: [Function (anonymous)],
      flush: [AsyncFunction: flush],
      getSentryRelease: [Function: getSentryRelease],
      lastEventId: [Function: lastEventId],
      DEFAULT_USER_INCLUDES: [Array],
      addRequestDataToEvent: [Function: addRequestDataToEvent],
      extractRequestData: [Function: extractRequestData],
      deepReadDirSync: [Function: deepReadDirSync],
      Handlers: [Object],
      Integrations: [Object]
    },
    GCPFunction: {
      wrapHttpFunction: [Function: wrapHttpFunction],
      wrapEventFunction: [Function: wrapEventFunction],
      wrapCloudEventFunction: [Function: wrapCloudEventFunction],
      defaultIntegrations: [Array],
      init: [Function: init]
    },
    AWSServices: [class AWSServices] { id: 'AWSServices' },
    Hub: [class Hub],
    SDK_VERSION: '7.43.0',
    Scope: [class Scope],
    addBreadcrumb: [Function: addBreadcrumb],
    addGlobalEventProcessor: [Function: addGlobalEventProcessor],
    captureEvent: [Function: captureEvent],
    captureException: [Function: captureException],
    captureMessage: [Function: captureMessage],
    configureScope: [Function: configureScope],
    createTransport: [Function: createTransport],
    getCurrentHub: [Function: getCurrentHub],
    getHubFromCarrier: [Function: getHubFromCarrier],
    makeMain: [Function: makeMain],
    setContext: [Function: setContext],
    setExtra: [Function: setExtra],
    setExtras: [Function: setExtras],
    setTag: [Function: setTag],
    setTags: [Function: setTags],
    setUser: [Function: setUser],
    startTransaction: [Function: startTransaction],
    withScope: [Function: withScope],
    NodeClient: [class NodeClient extends BaseClient],
    makeNodeTransport: [Function: makeNodeTransport],
    close: [AsyncFunction: close],
    defaultIntegrations: [
      [InboundFilters],
      [FunctionToString],
      [Console],
      [Http],
      [OnUncaughtException],
      [OnUnhandledRejection],
      [ContextLines],
      [LocalVariables],
      [Context],
      [Modules],
      [RequestData],
      [LinkedErrors]
    ],
    defaultStackParser: [Function (anonymous)],
    flush: [AsyncFunction: flush],
    getSentryRelease: [Function: getSentryRelease],
    init: [Function: init],
    lastEventId: [Function: lastEventId],
    DEFAULT_USER_INCLUDES: [ 'id', 'username', 'email' ],
    addRequestDataToEvent: [Function: addRequestDataToEvent],
    extractRequestData: [Function: extractRequestData],
    deepReadDirSync: [Function: deepReadDirSync],
    Handlers: {
      extractRequestData: [Function: extractRequestData],
      parseRequest: [Function: parseRequest],
      errorHandler: [Function: errorHandler],
      requestHandler: [Function: requestHandler],
      tracingHandler: [Function: tracingHandler]
    },
    Integrations: {
      FunctionToString: [Function],
      InboundFilters: [Function],
      Console: [Function],
      Http: [Function],
      OnUncaughtException: [Function],
      OnUnhandledRejection: [Function],
      LinkedErrors: [Function],
      Modules: [Function],
      ContextLines: [Function],
      Context: [Function],
      RequestData: [Function],
      LocalVariables: [Function]
    }
  }
}

@AbhiPrasad
Copy link
Member

Thanks for sticking with me @maxpain and helping debug, appreciate the help a lot!

I wonder now how we should solve this 🤔.

Is there a good way to mix namespace imports while preserving the wildcard export of the node package.

@AbhiPrasad
Copy link
Member

Opened #7457 to fix!

@maxpain
Copy link
Author

maxpain commented Mar 16, 2023

Thanks!

@AbhiPrasad
Copy link
Member

@maxpain fix is merged, will be part of the next SDK release. In the meantime, you can fall back to importing and using the @sentry/node package (since the serverless package just wraps that under the hood).

Again, appreciate the help debugging, couldn't have figured it out without your help!

@jansedlon
Copy link

@AbhiPrasad Hi! I think this is relevant for @sentry/remix as well. When I import things like import * as Sentry from '@sentry/remix', all the imports are under .default property.

@KarelVendla
Copy link

KarelVendla commented Feb 23, 2024

Hey. I am also experiencing something of that sort.
I have a nuxt3 project where we use @sentry/vue

basically I have this sentry.ts plugin

import * as Sentry from "@sentry/vue";
import type { CaptureContext, SeverityLevel } from "@sentry/types";
import type { ExclusiveEventHintOrCaptureContext } from "@sentry/core/types/utils/prepareEvent";

export default defineNuxtPlugin((nuxtApp) => {
  const {
    public: { sentryDsn, sentryEnabled, appEnv },
  } = useRuntimeConfig();

  console.log("sentry plugin loaded");

  if (!sentryDsn || sentryEnabled === "false") {
    return {
      provide: {
        sentry: {
          captureException: (_exception: any, _hint?: ExclusiveEventHintOrCaptureContext) => {},
          captureMessage: (_message: string, _captureContext?: CaptureContext | SeverityLevel) => {},
        },
      },
    };
  }

  console.log("sentry plugin init", Sentry);

  Sentry.init({
    app: nuxtApp.vueApp,
    dsn: sentryDsn as string,
    environment: appEnv as string,
    integrations: [],
  });

  console.log("sentry plugin initialized", Sentry);

  return {
    provide: {
      sentry: Sentry,
    },
  };
});

This works perfectly on dev environment, but when I build the nuxt application then sentry starts to serve captureMessage .. captureException etc functions from under default. .

console.logged the Sentry on a built app.

`[Module: null prototype] {
  VueIntegration: [Function: ConvertedIntegration] { id: 'Vue' },
  __esModule: true,
  attachErrorHandler: [Function: attachErrorHandler],
  browserTracingIntegration: [Function: browserTracingIntegration],
  createTracingMixins: [Function: createTracingMixins],
  default: {
    init: [Function: init],
    vueRouterInstrumentation: [Function: vueRouterInstrumentation],
    browserTracingIntegration: [Function: browserTracingIntegration],
    attachErrorHandler: [Function: attachErrorHandler],
    createTracingMixins: [Function: createTracingMixins],
    VueIntegration: [Function: ConvertedIntegration] { id: 'Vue' },
    vueIntegration: [Function: _vueIntegration],
    FunctionToString: [Function: ConvertedIntegration] { id: 'FunctionToString' },
    Hub: [class Hub],
    InboundFilters: [Function: ConvertedIntegration] { id: 'InboundFilters' },
    ModuleMetadata: [Function: ConvertedIntegration] { id: 'ModuleMetadata' },
    SDK_VERSION: '7.102.1',
    SEMANTIC_ATTRIBUTE_SENTRY_OP: 'sentry.op',
    SEMANTIC_ATTRIBUTE_SENTRY_ORIGIN: 'sentry.origin',
    SEMANTIC_ATTRIBUTE_SENTRY_SAMPLE_RATE: 'sentry.sample_rate',
    SEMANTIC_ATTRIBUTE_SENTRY_SOURCE: 'sentry.source',
    Scope: [class Scope],
    addBreadcrumb: [Function: addBreadcrumb],
    addEventProcessor: [Function: addEventProcessor],
    addGlobalEventProcessor: [Function: addGlobalEventProcessor],
    addIntegration: [Function: addIntegration],
    addTracingExtensions: [Function: addTracingExtensions],
    captureEvent: [Function: captureEvent],
    captureException: [Function: captureException],
    captureMessage: [Function: captureMessage],
    captureSession: [Function: captureSession],
    close: [AsyncFunction: close],
    configureScope: [Function: configureScope],
    continueTrace: [Function: continueTrace],
    createTransport: [Function: createTransport],
    endSession: [Function: endSession],
    extractTraceparentData: [Function: extractTraceparentData],
    flush: [AsyncFunction: flush],
    functionToStringIntegration: [Function: _functionToStringIntegration],
    getActiveSpan: [Function: getActiveSpan],
    getActiveTransaction: [Function: getActiveTransaction],
    getClient: [Function: getClient],
    getCurrentHub: [Function: getCurrentHub],
    getCurrentScope: [Function: getCurrentScope],
    getHubFromCarrier: [Function: getHubFromCarrier],
    getSpanStatusFromHttpCode: [Function: getSpanStatusFromHttpCode],
    inboundFiltersIntegration: [Function: _inboundFiltersIntegration],
    isInitialized: [Function: isInitialized],
    lastEventId: [Function: lastEventId],
    makeMain: [Function: makeMain],
    makeMultiplexedTransport: [Function: makeMultiplexedTransport],
    metrics: {
      increment: [Function: increment],
      distribution: [Function: distribution],
      set: [Function: set],
      gauge: [Function: gauge],
      MetricsAggregator: [Function],
      metricsAggregatorIntegration: [Function: _metricsAggregatorIntegration]
    },
    moduleMetadataIntegration: [Function: _moduleMetadataIntegration],
    parameterize: [Function: parameterize],
    setContext: [Function: setContext],
    setCurrentClient: [Function: setCurrentClient],
    setExtra: [Function: setExtra],
    setExtras: [Function: setExtras],
    setHttpStatus: [Function: setHttpStatus],
    setMeasurement: [Function: setMeasurement],
    setTag: [Function: setTag],
    setTags: [Function: setTags],
    setUser: [Function: setUser],
    spanStatusfromHttpCode: [Function: getSpanStatusFromHttpCode],
    startInactiveSpan: [Function: startInactiveSpan],
    startSession: [Function: startSession],
    startSpan: [Function: startSpan],
    startSpanManual: [Function: startSpanManual],
    startTransaction: [Function: startTransaction],
    trace: [Function: trace],
    withIsolationScope: [Function: withIsolationScope],
    withScope: [Function: withScope],
    WINDOW: <ref *1> Object [global] {
      global: [Circular *1],
      clearImmediate: [Function: clearImmediate],
      setImmediate: [Function],
      clearInterval: [Function: clearInterval],
      clearTimeout: [Function: clearTimeout],
      setInterval: [Function (anonymous)],
      setTimeout: [Function (anonymous)],
      queueMicrotask: [Function: queueMicrotask],
      structuredClone: [Function: structuredClone],
      atob: [Getter/Setter],
      btoa: [Getter/Setter],
      performance: [Getter/Setter],
      fetch: [Function: fetch],
      crypto: [Getter],
      _importMeta_: [Object],
      '$fetch': [AsyncFunction],
      __SENTRY__: [Object],
      onerror: [Function],
      onunhandledrejection: [Function],
      __VUE_INSTANCE_SETTERS__: [Array],
      __VUE_SSR_SETTERS__: [Array],
      __buildAssetsURL: [Function: buildAssetsURL],
      __publicAssetsURL: [Function: publicAssetsURL],
      __VUE_PROD_DEVTOOLS__: false,
      __unctx__: [Object],
      __unctx_async_handlers__: [Set],
      __VUE__: true,
      __unhead_injection_handler__: [Function (anonymous)],
      __vueuse_ssr_handlers__: {}
    },
    BrowserClient: [class BrowserClient extends BaseClient],
    makeFetchTransport: [Function: makeFetchTransport],
    makeXHRTransport: [Function: makeXHRTransport],
    chromeStackLineParser: [ 30, [Function: chrome] ],
    defaultStackLineParsers: [ [Array], [Array], [Array] ],
    defaultStackParser: [Function (anonymous)],
    geckoStackLineParser: [ 50, [Function: gecko] ],
    opera10StackLineParser: [ 10, [Function: opera10] ],
    opera11StackLineParser: [ 20, [Function: opera11] ],
    winjsStackLineParser: [ 40, [Function: winjs] ],
    eventFromException: [Function: eventFromException],
    eventFromMessage: [Function: eventFromMessage],
    exceptionFromError: [Function: exceptionFromError],
    createUserFeedbackEnvelope: [Function: createUserFeedbackEnvelope],
    captureUserFeedback: [Function: captureUserFeedback],
    defaultIntegrations: [
      [Object], [Object],
      [Object], [Object],
      [Object], [Object],
      [Object], [Object]
    ],
    forceLoad: [Function: forceLoad],
    getDefaultIntegrations: [Function: getDefaultIntegrations],
    onLoad: [Function: onLoad],
    showReportDialog: [Function: showReportDialog],
    wrap: [Function: wrap],
    Breadcrumbs: [Function: ConvertedIntegration] { id: 'Breadcrumbs' },
    breadcrumbsIntegration: [Function: _breadcrumbsIntegration],
    Dedupe: [Function: ConvertedIntegration] { id: 'Dedupe' },
    dedupeIntegration: [Function: _dedupeIntegration],
    GlobalHandlers: [Function: ConvertedIntegration] { id: 'GlobalHandlers' },
    globalHandlersIntegration: [Function: _globalHandlersIntegration],
    HttpContext: [Function: ConvertedIntegration] { id: 'HttpContext' },
    httpContextIntegration: [Function: _httpContextIntegration],
    LinkedErrors: [Function: ConvertedIntegration] { id: 'LinkedErrors' },
    linkedErrorsIntegration: [Function: _linkedErrorsIntegration],
    TryCatch: [Function: ConvertedIntegration] { id: 'TryCatch' },
    browserApiErrorsIntegration: [Function: _browserApiErrorsIntegration],
    Replay: [class Replay] { id: 'Replay' },
    getReplay: [Function: getReplay],
    replayIntegration: [Function: replayIntegration],
    ReplayCanvas: [Function: ConvertedIntegration] { id: 'ReplayCanvas' },
    replayCanvasIntegration: [Function: _replayCanvasIntegration],
    Feedback: [class Feedback] { id: 'Feedback' },
    feedbackIntegration: [Function: feedbackIntegration],
    sendFeedback: [Function: sendFeedback],
    BrowserTracing: [class BrowserTracing],
    defaultRequestInstrumentationOptions: {
      traceFetch: true,
      traceXHR: true,
      enableHTTPTimings: true,
      tracingOrigins: [Array],
      tracePropagationTargets: [Array]
    },
    instrumentOutgoingRequests: [Function: instrumentOutgoingRequests],
    startBrowserTracingNavigationSpan: [Function: startBrowserTracingNavigationSpan],
    startBrowserTracingPageLoadSpan: [Function: startBrowserTracingPageLoadSpan],
    makeBrowserOfflineTransport: [Function: makeBrowserOfflineTransport],
    onProfilingStartRouteTransaction: [Function: onProfilingStartRouteTransaction],
    BrowserProfilingIntegration: [Function: ConvertedIntegration] { id: 'BrowserProfiling' },
    browserProfilingIntegration: [Function: _browserProfilingIntegration],
    Integrations: {
      FunctionToString: [Function],
      InboundFilters: [Function],
      LinkedErrors: [Function],
      GlobalHandlers: [Function],
      TryCatch: [Function],
      Breadcrumbs: [Function],
      HttpContext: [Function],
      Dedupe: [Function]
    }
  },
  init: [Function: init],
  vueIntegration: [Function: _vueIntegration],
  vueRouterInstrumentation: [Function: vueRouterInstrumentation]
}`

console.logged sentry in dev environment.

`{
  init: [Function: init],
  vueRouterInstrumentation: [Function: vueRouterInstrumentation],
  browserTracingIntegration: [Function: browserTracingIntegration],
  attachErrorHandler: [Function: attachErrorHandler],
  createTracingMixins: [Function: createTracingMixins],
  VueIntegration: [Function: ConvertedIntegration] { id: 'Vue' },
  vueIntegration: [Function: _vueIntegration],
  FunctionToString: [Function: ConvertedIntegration] { id: 'FunctionToString' },
  Hub: [class Hub],
  InboundFilters: [Function: ConvertedIntegration] { id: 'InboundFilters' },
  ModuleMetadata: [Function: ConvertedIntegration] { id: 'ModuleMetadata' },
  SDK_VERSION: '7.102.1',
  SEMANTIC_ATTRIBUTE_SENTRY_OP: 'sentry.op',
  SEMANTIC_ATTRIBUTE_SENTRY_ORIGIN: 'sentry.origin',
  SEMANTIC_ATTRIBUTE_SENTRY_SAMPLE_RATE: 'sentry.sample_rate',
  SEMANTIC_ATTRIBUTE_SENTRY_SOURCE: 'sentry.source',
  Scope: [class Scope],
  addBreadcrumb: [Function: addBreadcrumb],
  addEventProcessor: [Function: addEventProcessor],
  addGlobalEventProcessor: [Function: addGlobalEventProcessor],
  addIntegration: [Function: addIntegration],
  addTracingExtensions: [Function: addTracingExtensions],
  captureEvent: [Function: captureEvent],
  captureException: [Function: captureException],
  captureMessage: [Function: captureMessage],
  captureSession: [Function: captureSession],
  close: [AsyncFunction: close],
  configureScope: [Function: configureScope],
  continueTrace: [Function: continueTrace],
  createTransport: [Function: createTransport],
  endSession: [Function: endSession],
  extractTraceparentData: [Function: extractTraceparentData],
  flush: [AsyncFunction: flush],
  functionToStringIntegration: [Function: _functionToStringIntegration],
  getActiveSpan: [Function: getActiveSpan],
  getActiveTransaction: [Function: getActiveTransaction],
  getClient: [Function: getClient],
  getCurrentHub: [Function: getCurrentHub],
  getCurrentScope: [Function: getCurrentScope],
  getHubFromCarrier: [Function: getHubFromCarrier],
  getSpanStatusFromHttpCode: [Function: getSpanStatusFromHttpCode],
  inboundFiltersIntegration: [Function: _inboundFiltersIntegration],
  isInitialized: [Function: isInitialized],
  lastEventId: [Function: lastEventId],
  makeMain: [Function: makeMain],
  makeMultiplexedTransport: [Function: makeMultiplexedTransport],
  metrics: {
    increment: [Function: increment],
    distribution: [Function: distribution],
    set: [Function: set],
    gauge: [Function: gauge],
    MetricsAggregator: [Function: ConvertedIntegration] { id: 'MetricsAggregator' },
    metricsAggregatorIntegration: [Function: _metricsAggregatorIntegration]
  },
  moduleMetadataIntegration: [Function: _moduleMetadataIntegration],
  parameterize: [Function: parameterize],
  setContext: [Function: setContext],
  setCurrentClient: [Function: setCurrentClient],
  setExtra: [Function: setExtra],
  setExtras: [Function: setExtras],
  setHttpStatus: [Function: setHttpStatus],
  setMeasurement: [Function: setMeasurement],
  setTag: [Function: setTag],
  setTags: [Function: setTags],
  setUser: [Function: setUser],
  spanStatusfromHttpCode: [Function: getSpanStatusFromHttpCode],
  startInactiveSpan: [Function: startInactiveSpan],
  startSession: [Function: startSession],
  startSpan: [Function: startSpan],
  startSpanManual: [Function: startSpanManual],
  startTransaction: [Function: startTransaction],
  trace: [Function: trace],
  withIsolationScope: [Function: withIsolationScope],
  withScope: [Function: withScope],
  WINDOW: <ref *1> Object [global] {
    global: [Circular *1],
    clearImmediate: [Function: clearImmediate],
    setImmediate: [Function: setImmediate] {
      [Symbol(nodejs.util.promisify.custom)]: [Getter]
    },
    clearInterval: [Function: clearInterval],
    clearTimeout: [Function: clearTimeout],
    setInterval: [Function (anonymous)],
    setTimeout: [Function (anonymous)],
    queueMicrotask: [Function: queueMicrotask],
    structuredClone: [Function: structuredClone],
    atob: [Getter/Setter],
    btoa: [Getter/Setter],
    performance: [Getter/Setter],
    fetch: [Function: fetch],
    crypto: [Getter],
    __VUE_HMR_RUNTIME__: {
      createRecord: [Function (anonymous)],
      rerender: [Function (anonymous)],
      reload: [Function (anonymous)]
    },
    __VUE_INSTANCE_SETTERS__: [ [Function (anonymous)], [Function (anonymous)] ],
    __VUE_SSR_SETTERS__: [ [Function (anonymous)], [Function (anonymous)] ],
    _importMeta_: {
      url: 'file:///C:/Users/karel/Desktop/I/dev/yazio/web-funnels/.nuxt/dev/index.mjs',
      env: [Object]
    },
    '$fetch': [AsyncFunction: $fetch2] {
      raw: [AsyncFunction: $fetchRaw2],
      native: [Function (anonymous)],
      create: [Function (anonymous)]
    },
    __SENTRY__: {
      extensions: [Object],
      hub: [Hub],
      acs: [Object],
      globalEventProcessors: []
    },
    onerror: [Function (anonymous)] { __SENTRY_INSTRUMENTED__: true },
    onunhandledrejection: [Function (anonymous)] { __SENTRY_INSTRUMENTED__: true },
    __buildAssetsURL: [Function: buildAssetsURL],
    __publicAssetsURL: [Function: publicAssetsURL],
    __unctx__: { get: [Function: get] },
    __unctx_async_handlers__: Set(2) { [Function: onLeave], [Function: onLeave] },
    __VUE_PROD_DEVTOOLS__: false,
    __INTLIFY_PROD_DEVTOOLS__: false,
    __INTLIFY__: true,
    __VUE__: true,
    __unhead_injection_handler__: [Function (anonymous)],
    __vueuse_ssr_handlers__: {},
    __VUE_DEVTOOLS_PLUGINS__: [ [Object], [Object] ]
  },
  BrowserClient: [class BrowserClient extends BaseClient],
  makeFetchTransport: [Function: makeFetchTransport],
  makeXHRTransport: [Function: makeXHRTransport],
  chromeStackLineParser: [ 30, [Function: chrome] ],
  defaultStackLineParsers: [
    [ 30, [Function: chrome] ],
    [ 50, [Function: gecko] ],
    [ 40, [Function: winjs] ]
  ],
  defaultStackParser: [Function (anonymous)],
  geckoStackLineParser: [ 50, [Function: gecko] ],
  opera10StackLineParser: [ 10, [Function: opera10] ],
  opera11StackLineParser: [ 20, [Function: opera11] ],
  winjsStackLineParser: [ 40, [Function: winjs] ],
  eventFromException: [Function: eventFromException],
  eventFromMessage: [Function: eventFromMessage],
  exceptionFromError: [Function: exceptionFromError],
  createUserFeedbackEnvelope: [Function: createUserFeedbackEnvelope],
  captureUserFeedback: [Function: captureUserFeedback],
  defaultIntegrations: [
    {
      name: 'InboundFilters',
      setupOnce: [Function: setupOnce],
      processEvent: [Function: processEvent],
      isDefaultInstance: true
    },
    {
      name: 'FunctionToString',
      setupOnce: [Function: setupOnce],
      setup: [Function: setup],
      isDefaultInstance: true
    },
    {
      name: 'TryCatch',
      setupOnce: [Function: setupOnce],
      isDefaultInstance: true
    },
    {
      name: 'Breadcrumbs',
      setupOnce: [Function: setupOnce],
      setup: [Function: setup],
      isDefaultInstance: true
    },
    {
      name: 'GlobalHandlers',
      setupOnce: [Function: setupOnce],
      setup: [Function: setup],
      isDefaultInstance: true
    },
    {
      name: 'LinkedErrors',
      setupOnce: [Function: setupOnce],
      preprocessEvent: [Function: preprocessEvent],
      isDefaultInstance: true
    },
    {
      name: 'Dedupe',
      setupOnce: [Function: setupOnce],
      processEvent: [Function: processEvent],
      isDefaultInstance: true
    },
    {
      name: 'HttpContext',
      setupOnce: [Function: setupOnce],
      preprocessEvent: [Function: preprocessEvent],
      isDefaultInstance: true
    }
  ],
  forceLoad: [Function: forceLoad],
  getDefaultIntegrations: [Function: getDefaultIntegrations],
  onLoad: [Function: onLoad],
  showReportDialog: [Function: showReportDialog],
  wrap: [Function: wrap],
  Breadcrumbs: [Function: ConvertedIntegration] { id: 'Breadcrumbs' },
  breadcrumbsIntegration: [Function: _breadcrumbsIntegration],
  Dedupe: [Function: ConvertedIntegration] { id: 'Dedupe' },
  dedupeIntegration: [Function: _dedupeIntegration],
  GlobalHandlers: [Function: ConvertedIntegration] { id: 'GlobalHandlers' },
  globalHandlersIntegration: [Function: _globalHandlersIntegration],
  HttpContext: [Function: ConvertedIntegration] { id: 'HttpContext' },
  httpContextIntegration: [Function: _httpContextIntegration],
  LinkedErrors: [Function: ConvertedIntegration] { id: 'LinkedErrors' },
  linkedErrorsIntegration: [Function: _linkedErrorsIntegration],
  TryCatch: [Function: ConvertedIntegration] { id: 'TryCatch' },
  browserApiErrorsIntegration: [Function: _browserApiErrorsIntegration],
  Replay: [class Replay] { id: 'Replay' },
  getReplay: [Function: getReplay],
  replayIntegration: [Function: replayIntegration],
  ReplayCanvas: [Function: ConvertedIntegration] { id: 'ReplayCanvas' },
  replayCanvasIntegration: [Function: _replayCanvasIntegration],
  Feedback: [class Feedback] { id: 'Feedback' },
  feedbackIntegration: [Function: feedbackIntegration],
  sendFeedback: [Function: sendFeedback],
  BrowserTracing: [class BrowserTracing],
  defaultRequestInstrumentationOptions: {
    traceFetch: true,
    traceXHR: true,
    enableHTTPTimings: true,
    tracingOrigins: [ 'localhost', /^\/(?!\/)/ ],
    tracePropagationTargets: [ 'localhost', /^\/(?!\/)/ ]
  },
  instrumentOutgoingRequests: [Function: instrumentOutgoingRequests],
  startBrowserTracingNavigationSpan: [Function: startBrowserTracingNavigationSpan],
  startBrowserTracingPageLoadSpan: [Function: startBrowserTracingPageLoadSpan],
  makeBrowserOfflineTransport: [Function: makeBrowserOfflineTransport],
  onProfilingStartRouteTransaction: [Function: onProfilingStartRouteTransaction],
  BrowserProfilingIntegration: [Function: ConvertedIntegration] { id: 'BrowserProfiling' },
  browserProfilingIntegration: [Function: _browserProfilingIntegration],
  Integrations: {
    FunctionToString: [Function: ConvertedIntegration] { id: 'FunctionToString' },
    InboundFilters: [Function: ConvertedIntegration] { id: 'InboundFilters' },
    LinkedErrors: [Function: ConvertedIntegration] { id: 'LinkedErrors' },
    GlobalHandlers: [Function: ConvertedIntegration] { id: 'GlobalHandlers' },
    TryCatch: [Function: ConvertedIntegration] { id: 'TryCatch' },
    Breadcrumbs: [Function: ConvertedIntegration] { id: 'Breadcrumbs' },
    HttpContext: [Function: ConvertedIntegration] { id: 'HttpContext' },
    Dedupe: [Function: ConvertedIntegration] { id: 'Dedupe' }
  }
}
`

@AbhiPrasad
Copy link
Member

@KarelVendla please open a new GH issue - we need more details around SDK version and nuxt/vite version to help debug.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Package: serverless Issues related to the Sentry Serverless SDK Type: Bug
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants