Skip to content

Commit

Permalink
added honeybadger for monitoring
Browse files Browse the repository at this point in the history
  • Loading branch information
Dhravya committed Aug 17, 2022
1 parent 3a972ec commit e88c60d
Show file tree
Hide file tree
Showing 6 changed files with 333 additions and 56 deletions.
3 changes: 3 additions & 0 deletions .vscode/settings.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
{
"cSpell.words": ["Honeybadger"]
}
38 changes: 37 additions & 1 deletion next.config.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,13 @@
/** @type {import('next').NextConfig} */

const withPWA = require("next-pwa");
const HoneybadgerSourceMapPlugin = require("@honeybadger-io/webpack");
const { execSync } = require("child_process");

const {
HONEYBADGER_API_KEY,
NODE_ENV,
} = process.env;

const nextConfig = withPWA({
reactStrictMode: false,
Expand All @@ -11,6 +18,35 @@ const nextConfig = withPWA({
disable: process.env.NODE_ENV === "development",
},
experimental: { images: { allowFutureImage: true } },
env: {
HONEYBADGER_API_KEY
},
webpack: (config, options) => {
// When all the Honeybadger configuration env variables are
// available/configured The Honeybadger webpack plugin gets pushed to the
// webpack plugins to build and upload the source maps to Honeybadger.
// This is an alternative to manually uploading the source maps.
// See https://docs.honeybadger.io/lib/javascript/guides/using-source-maps.html
// Note: This is disabled in development mode.
if (HONEYBADGER_API_KEY && NODE_ENV != "development") {
// `config.devtool` must be 'hidden-source-map' or 'source-map' to properly pass sourcemaps.
// Next.js uses regular `source-map` which doesnt pass its sourcemaps to Webpack.
// https://github.com/vercel/next.js/blob/89ec21ed686dd79a5770b5c669abaff8f55d8fef/packages/next/build/webpack/config/blocks/base.ts#L40
config.devtool = "hidden-source-map";

config.plugins.push(
new HoneybadgerSourceMapPlugin({
apiKey: HONEYBADGER_API_KEY,
assetsUrl:
process.env.NODE_ENV == "development"
? "http://localhost:3000"
: "https://lmfao.tech/_next",
})
);
}

return config;
},
});

module.exports = nextConfig
module.exports = nextConfig;
3 changes: 3 additions & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,9 @@
"@fortawesome/free-solid-svg-icons": "^6.1.2",
"@fortawesome/react-fontawesome": "^0.2.0",
"@heroicons/react": "^1.0.6",
"@honeybadger-io/js": "^4.1.0",
"@honeybadger-io/react": "^2.1.0",
"@honeybadger-io/webpack": "^1.5.1",
"@novu/node": "^0.6.0",
"@novu/notification-center": "^0.6.2",
"@prisma/client": "^4.0.0",
Expand Down
144 changes: 144 additions & 0 deletions pnpm-lock.yaml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Loading

0 comments on commit e88c60d

Please sign in to comment.