Sentry-react-native: Error: Unable to resolve module ./web-vitals/getTTFB

Created on 10 Jun 2021  ·  7Comments  ·  Source: getsentry/sentry-react-native

After update to last version 2.5.0 i start receive errors

Error: Unable to resolve module ./web-vitals/getTTFB from node_modules/@sentry/tracing/dist/browser/metrics.js:
None of these files exist:

  • node_modules/@sentry/tracing/dist/browser/web-vitals/getTTFB(.native|.android.js|.native.js|.js|.android.json|.native.json|.json|.android.ts|.native.ts|.ts|.android.tsx|.native.tsx|.tsx)
  • node_modules/@sentry/tracing/dist/browser/web-vitals/getTTFB/index(.native|.android.js|.native.js|.js|.android.json|.native.json|.json|.android.ts|.native.ts|.ts|.android.tsx|.native.tsx|.tsx)

1 | Object.defineProperty(exports, "__esModule", { value: true });
2 | var tslib_1 = require("tslib");
3 | var utils_1 = require("@sentry/utils");
4 | var utils_2 = require("../utils");

Support Issue

Most helpful comment

Same issue, deleting node_modules did not work.
I checked node_modules/@sentry/tracing/dist/browser/metrics.js and getTTFB seems to be removed:

Object.defineProperty(exports, "__esModule", { value: true });
var tslib_1 = require("tslib");
var utils_1 = require("@sentry/utils");
var utils_2 = require("../utils");
var getCLS_1 = require("./web-vitals/getCLS");
var getFID_1 = require("./web-vitals/getFID");
var getLCP_1 = require("./web-vitals/getLCP");
var getFirstHidden_1 = require("./web-vitals/lib/getFirstHidden");
var global = utils_1.getGlobalObject();

// ...
❯ npm ls @sentry/tracing
mtd-mobile@ /Users/manu/Code/mtd-mobile
└─┬ @sentry/[email protected]
  └── @sentry/[email protected]

it appears to be a cache issue: watchman watch-del-all && npm run start -- --reset-cache

@Systerr can you confirm it is working on your end after running that? It did the trick for me

All 7 comments

@Systerr Can you try completely deleting your node_modules and reinstalling? Does the issue persist?

Yes exists.
I pinned version 2.4.3 on my package.json and all works good

@Systerr Do you have @sentry/tracing installed or anything else other than @sentry/react-native in your dependencies? getTTFB was removed in 6.4.0 https://github.com/getsentry/sentry-javascript/commit/e5c7ef9769cff9700010ef400e406951a7acfd44#diff-f2c3c293e30c7b48baeca96631f69f8cae69bc72d3c5f03f7b3ee490dcb0a3ea

Deps contains only @sentry/react-native no any sentry related stuff exists

@Systerr Can you check the filenode_modules/@sentry/tracing/dist/browser/metrics.js and make sure it does not have an import for ./web-vitals/getTTFB. As we removed it from the file: https://github.com/getsentry/sentry-javascript/blob/master/packages/tracing/src/browser/metrics.ts, it shouldn't exist. If that error occurs it means for some reason you have an older version of the tracing library.

Same issue, deleting node_modules did not work.
I checked node_modules/@sentry/tracing/dist/browser/metrics.js and getTTFB seems to be removed:

Object.defineProperty(exports, "__esModule", { value: true });
var tslib_1 = require("tslib");
var utils_1 = require("@sentry/utils");
var utils_2 = require("../utils");
var getCLS_1 = require("./web-vitals/getCLS");
var getFID_1 = require("./web-vitals/getFID");
var getLCP_1 = require("./web-vitals/getLCP");
var getFirstHidden_1 = require("./web-vitals/lib/getFirstHidden");
var global = utils_1.getGlobalObject();

// ...
❯ npm ls @sentry/tracing
mtd-mobile@ /Users/manu/Code/mtd-mobile
└─┬ @sentry/[email protected]
  └── @sentry/[email protected]

it appears to be a cache issue: watchman watch-del-all && npm run start -- --reset-cache

@Systerr can you confirm it is working on your end after running that? It did the trick for me

@kamui545 yes helped me. Thank you!

Was this page helpful?
0 / 5 - 0 ratings