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

Unable to migrate to latest sdk versions in my capacitor/react app #794

Closed
maxwelljmckee opened this issue Nov 25, 2024 · 3 comments
Closed

Comments

@maxwelljmckee
Copy link

maxwelljmckee commented Nov 25, 2024

Environment

What version are you running? Etc.

"@sentry/capacitor": "^1.0.2",
"@sentry/cli": "^2.25.3",
"@sentry/react": "8.37.1",

"@capacitor/core": "^6.1.2",
"react": "^18.2.0",

Steps to Reproduce

  1. Bumped both @sentry/capacitor and @sentry/react using npm i @sentry/capacitor@latest @sentry/react@latest
  2. Received some error output indicating a peer dependency violation. @sentry/capacitor@latest requires a very specific, exact version of @sentry/[email protected]
  3. Fine, I installed the exact version npm i @sentry/[email protected] --save-exact
  4. My app appears to compile and run without issue, but there is still a large error output indicating some variable or export mismatch in sentry internals

Expected Result

When the correct sdk versions and peerDeps are installed, the app should run without errors

Actual Result

ERROR in ./node_modules/@sentry/core/build/esm/utils/sdkMetadata.js 26:15-26
export 'SDK_VERSION' (imported as 'SDK_VERSION') was not found in '@sentry/utils' (possible exports: BAGGAGE_HEADER_NAME, CONSOLE_LEVELS, DEFAULT_RETRY_AFTER, GLOBAL_OBJ, LRUMap, MAX_BAGGAGE_STRING_LENGTH, SENTRY_BAGGAGE_KEY_PREFIX, SENTRY_BAGGAGE_KEY_PREFIX_REGEX, SENTRY_XHR_DATA_KEY, SentryError, SyncPromise, TRACEPARENT_REGEXP, _asyncNullishCoalesce, _asyncOptionalChain, _asyncOptionalChainDelete, _browserPerformanceTimeOriginMode, _nullishCoalesce, _optionalChain, _optionalChainDelete, addContextToFrame, addExceptionMechanism, addExceptionTypeValue, addInstrumentationHandler, addItemToEnvelope, addNonEnumerableProperty, addOrUpdateIntegration, addRequestDataToEvent, addRequestDataToTransaction, applyAggregateErrorsToEvent, arrayify, baggageHeaderToDynamicSamplingContext, basename, browserPerformanceTimeOrigin, checkOrSetAlreadyCaught, consoleSandbox, convertToPlainObject, createAttachmentEnvelopeItem, createClientReportEnvelope, createDebugPauseMessageHandler, createEnvelope, createEventEnvelopeHeaders, createStackParser, dateTimestampInSeconds, dirname, disabledUntil, dropUndefinedKeys, dsnFromString, dsnToString, dynamicRequire, dynamicSamplingContextToSentryBaggageHeader, envelopeContainsItemType, envelopeItemTypeToDataCategory, escapeStringForRegex, eventFromMessage, eventFromUnknownInput, exceptionFromError, extractExceptionKeysForMessage, extractPathForTransaction, extractRequestData, extractTraceparentData, filenameIsInApp, fill, forEachEnvelopeItem, generateSentryTraceHeader, getDomElement, getEventDescription, getFunctionName, getGlobalObject, getGlobalSingleton, getLocationHref, getNumberOfUrlSegments, getOriginalFunction, getSDKSource, getSanitizedUrlString, getSdkMetadataForEnvelopeHeader, htmlTreeAsString, instrumentDOM, instrumentXHR, isAbsolute, isBrowser, isBrowserBundle, isDOMError, isDOMException, isElement, isError, isErrorEvent, isEvent, isInstanceOf, isMatchingPattern, isNaN, isNativeFetch, isNodeEnv, isPlainObject, isPrimitive, isRateLimited, isRegExp, isString, isSyntheticEvent, isThenable, isVueViewModel, join, loadModule, logger, makeDsn, makeFifoCache, makePromiseBuffer, markFunctionWrapped, memoBuilder, nodeStackLineParser, normalize, normalizePath, normalizeToSize, objectify, originalConsoleMethods, parseEnvelope, parseFetchArgs, parseRetryAfterHeader, parseSemver, parseStackFrames, parseUrl, rejectedSyncPromise, relative, resetInstrumentationHandlers, resolve, resolvedSyncPromise, safeJoin, serializeEnvelope, severityFromString, severityLevelFromString, snipLine, stackParserFromStackParserOptions, stringMatchesSomePattern, stripSentryFramesAndReverse, stripUrlQueryAndFragment, supportsDOMError, supportsDOMException, supportsErrorEvent, supportsFetch, supportsHistory, supportsNativeFetch, supportsReferrerPolicy, supportsReportingObserver, timestampInSeconds, timestampWithMs, tracingContextFromHeaders, truncate, updateRateLimits, urlEncode, usingPerformanceAPI, uuid4, validSeverityLevels, walk, watchdogTimer)
 @ ./node_modules/@sentry/core/build/esm/index.js 41:0-58 41:0-58
 @ ./node_modules/@sentry/capacitor/dist/esm/index.js 2:0-457 2:0-457 2:0-457 2:0-457 2:0-457 2:0-457 2:0-457 2:0-457 2:0-457 2:0-457 2:0-457 2:0-457 2:0-457 2:0-457 2:0-457 2:0-457 2:0-457 2:0-457 2:0-457 2:0-457 2:0-457 2:0-457 2:0-457 2:0-457 2:0-457 2:0-457 2:0-457 2:0-457 2:0-457 2:0-457 2:0-457
 @ ./src/sentry.js 20:37-65
 @ ./src/logger.js 32:37-54
 @ ./src/index.js 32:37-54

webpack 5.94.0 compiled with 54 errors in 3422 ms
@lucas-zimerman
Copy link
Collaborator

Hi and thank you for opening this issue!
Could you tell the versions inside the package @sentry/utils, @sentry/react and @sentry/capacitor?
you can find this information at node_modules/@sentry/utils/package.json, node_modules/@sentry/react/package.json, node_modules/@sentry/capacitor/package.json

@maxwelljmckee
Copy link
Author

maxwelljmckee commented Nov 26, 2024

Hi @lucas-zimerman, thanks for your help!

node_modules/@sentry/utils/package.json => 7.81.1
node_modules/@sentry/react/package.json => 8.37.1
node_modules/@sentry/capacitor/package.json => 1.0.2

@maxwelljmckee
Copy link
Author

I just ran npm upgrade @sentry/utils and it looks like I can now compile without errors. Seems that for some reason this upgrade was not made automatically when I made the other version migrations

@kahest kahest closed this as completed Nov 27, 2024
@github-project-automation github-project-automation bot moved this from Needs Discussion to Done in Mobile & Cross Platform SDK Nov 27, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
Status: Done
Development

No branches or pull requests

3 participants