bugfender / rn-bugfender

Bugfender for React Native
https://bugfender.com
Apache License 2.0
30 stars 6 forks source link

self is not defined NextJS app #82

Closed juanjlunar closed 10 months ago

juanjlunar commented 10 months ago

Hi there, this error happens when we try to init the library on a NextJS app using React Native Web on the _app.tsx entry point.

We tried transpiling the modules using the next.config.js but it didn't work either.

import { Bugfender } from '@bugfender/rn-bugfender';

Bugfender.init({
appKey: 'MY_APP_KEY'
})

Or

import { Bugfender } from '@bugfender/sdk';

Bugfender.init({
appKey: 'MY_APP_KEY'
})

Transpiling the packages in the next.config.js.

Screenshot 2023-12-25 at 4 07 37 PM

Without transpiling the '@bugfender/rn-bugfender' module.

Screenshot 2023-12-25 at 4 30 01 PM

Using a react app using webpack it works fine, apparently, something is happening with the NextJS config.

jgimenez commented 10 months ago

Hi @juanjlunar, Bugfender is for front-end applications, so you can't run it on a Node.js server.

juanjlunar commented 10 months ago

I managed to make it work just fine using NextJS, but I think you should add the support for NextJS, this is a frontend app.

jgimenez commented 10 months ago

What kind of support is missing? How did you make it work?