Closed as not planned
Description
openedon Oct 15, 2024
Is there an existing issue for this?
- I have checked for existing issues https://github.com/getsentry/sentry-javascript/issues
- I have reviewed the documentation https://docs.sentry.io/
- I am using the latest SDK release https://github.com/getsentry/sentry-javascript/releases
How do you use Sentry?
Self-hosted/on-premise
Which SDK are you using?
@sentry/browser
SDK Version
8.34.0
Framework Version
No response
Link to Sentry event
No response
Reproduction Example/SDK Setup
const integrations = getDefaultIntegrations({}).filter((defaultIntegration) => {
return !['BrowserApiErrors', 'Breadcrumbs', 'GlobalHandlers'].includes(
defaultIntegration.name,
);
});
const feedback = feedbackIntegration({
autoInject: false,
colorScheme: 'light',
showScreenshot: true,
onSubmitError: (error: Error) => {
console.log('onSubmitError', error);
},
});
const client = new BrowserClient({
dsn: import.meta.env.VITE_SCENTRY_DSN,
transport: makeFetchTransport,
stackParser: defaultStackParser,
integrations: [...integrations, feedback],
});
export const scope = new Scope();
scope.setClient(client);
client.init();
Steps to Reproduce
console.log(getFeedback()) // return undefined
console.log(scope.getClient()?.getIntegrationByName('Feedback')) // return feedbackIntegration
captureFeedback(
{
name: 'Jane Doe',
email: '[email protected]',
message: 'This is an example feedback',
},
{},
scope,
); // sends feedback
const form = await feedback.createForm();
form.appendToDom();
form.open();
Try to submit feedback form
Expected Result
- I can bind feedback to my
scope
getFeedback()
returnfeedbackIntegration
with myscope
Actual Result
Catch the error when submit form
onSubmitError Error: No client setup, cannot send feedback.
setCurrentClient(client);
console.log(getFeedback()) // return feedbackIntegration
After that feedback form is submits without errors
Metadata
Assignees
Type
Projects
Status
Waiting for: Community
Activity