raygun4node
raygun4node copied to clipboard
Fix warning "module.parent.require is not supported by webpack"
I have a repro of this issue at https://github.com/tansongyang/raygun-webpack-issue-repro.
Run npm run build in the console. Here's the output:
> next build
▲ Next.js 14.1.0
Creating an optimized production build ...
⚠ Compiled with warnings
./node_modules/raygun/build/raygun.js
module.parent.require is not supported by webpack.
Import trace for requested module:
./node_modules/raygun/build/raygun.js
./app/raygun.ts
./app/page.tsx
./node_modules/raygun/build/raygun.js
Module not found: Can't resolve 'raygun-apm/lib/src/crash_reporting' in '/Users/frank/Code/raygun-webpack-issue-repro/node_modules/raygun/build'
Import trace for requested module:
./node_modules/raygun/build/raygun.js
./app/raygun.ts
./app/page.tsx
Source appears to be here: https://github.com/MindscapeHQ/raygun4node/blob/v0.13.0/lib/raygun.ts#L51
Not sure what the fix is, but if I navigate to the file in VS Code, I get a warning that module.parent is deprecated: