-
-
Notifications
You must be signed in to change notification settings - Fork 58
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
Renderer fails on 'fs' requirement #355
Comments
There is no usage of The supplied stacktrace seems to suggest that Do you have a repository that reproduces this? None of the existing tests or examples exhibit this behaviour. |
It's Strange because I do not get these errors if i remove Sentry SDK usage from my codebase (Production code). I was able to at least compile the code by changing the webpack Now after making those above changes, I still get the My Renderer is in 'React + Typescript' and Main in JS + TS. This is my webpack config. entry: [path.join(__dirname, '..', 'src', 'renderer', 'index.tsx')], target: 'electron-renderer', module: {
resolve: {
},
},` |
Based on the Stack Tree, it looks like Sentry/Renderer is calling Sentry/Backend which in turn may be utilizing the Module not found: Error: Can't resolve 'fs' in '/Users/muhammad.umer/Repo/hub.uw-hub/node_modules/electron' The originating file is a renderer in the stack trace. |
Check out the webpack configuration for the isolated test app: |
Yeah, this seems to fix the issue. Thanks Although I encountered a few more. 2 - After two init implementations, Sentry.captureError seems to work from main, but Sentry is not capturing unhandled exceptions of the main process. Although it does capture unhandled exceptions of the Renderer process. |
Version
I am integration Sentry to an Electron app using this SDK, so far the Main Process seems to be working fine & sending the event to sentry, but the renderer doesn't work.
I always throw an error
Module not found: Error: Can't resolve 'fs' in '/Users/muhammad.umer/Repo/hub.uw-hub/node_modules/electron' @ ./node_modules/electron/index.js 1:9-22 @ ./node_modules/@sentry/electron/esm/renderer/backend.js @ ./node_modules/@sentry/electron/esm/renderer/index.js @ ./src/renderer/features/downloadDrawer/DownloadDrawer.tsx @ ./src/renderer/layout/AppLayout.tsx @ ./src/renderer/App.tsx @ ./src/renderer/index.tsx @ multi ./src/renderer/index.tsx
I am initializing in the Preload script of my renderer(Browser Window).
Preload.js
const Sentry = require('@sentry/electron/dist/renderer');
Sentry.init({ dsn: 'https://000@000.ingest.sentry.io/000' });
I am explicitly referencing the renderer dist from the SDK in my renderer process, but don't seem to understand why it is referring to nodeFS.
BrowserWindow options
webPreferences: { textAreasAreResizable: false, preload: path.join(__dirname, 'preloads', 'mainWindowPreload.js'), enableRemoteModule: true, },
The text was updated successfully, but these errors were encountered: