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

error prepareBundle is not defined #4404

Open
yogeshBadgujar7 opened this issue Dec 23, 2024 · 0 comments
Open

error prepareBundle is not defined #4404

yogeshBadgujar7 opened this issue Dec 23, 2024 · 0 comments

Comments

@yogeshBadgujar7
Copy link

What React Native libraries do you use?

RN New Architecture

Are you using sentry.io or on-premise?

sentry.io (SaS)

@sentry/react-native SDK Version

^6.0.0

How does your development environment look like?

error prepareBundle is not defined

FAILURE: Build failed with an exception.

  • What went wrong:
    Execution failed for task ':app:createBundleReviewDebugJsAndAssets'.

Process 'command 'node'' finished with non-zero exit value 1

Sentry.init()

Sentry.init({
dsn: 'https://MYSENTRY_DNS',
environment:"development",
tracesSampleRate: 1.0,
profilesSampleRate: 1.0,
enableAutoSessionTracking: true,
integrations: [navigationIntegration],
_experiments: {
replaysSessionSampleRate: 1.0,
replaysOnErrorSampleRate: 1.0,
},
enableAutoPerformanceTracing: true,
enableAppStartTracking: true,
});

Steps to Reproduce

Go to the metro.config.js

add following things =>

const { getDefaultConfig, mergeConfig } = require("@react-native/metro-config");

const {
withSentryConfig
} = require("@sentry/react-native/metro");

const myCustomSerializer = (entryPoint, preModules, graph, options) => {
let bundle = prepareBundle(entryPoint, preModules, graph, options);
if (options.sentryBundleCallback) {
// Callback adds Sentry Debug IDs module to the bundle
bundle = options.sentryBundleCallback(bundle);
}
const code = createCode(bundle);
const map = createSourceMap();
return { code, map };
};

const config = {
serializer:{
customSerializer:myCustomSerializer
}
};

module.exports = withSentryConfig(mergeConfig(defaultConfig, config));

Expected Result

It should be give the Debug id and works according to doc

https://docs.sentry.io/platforms/react-native/manual-setup/metro/

Actual Result

Getting Error when i was trying to Run my React native application.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
Status: Waiting for: Product Owner
Status: Needs Discussion
Development

No branches or pull requests

1 participant