Closed
Description
- Review the documentation: https://docs.sentry.io/
- Search for existing issues: https://github.com/getsentry/sentry-javascript/issues
- Use the latest release: https://github.com/getsentry/sentry-javascript/releases
- Provide a link to the affected event from your Sentry account
Package + Version
-
@sentry/browser
-
@sentry/node
-
raven-js
-
raven-node
(raven for node) - other:
Version:
"@sentry/nextjs": "^6.11.0"
Description
Describe your issue in detail, ideally, you have a reproducible demo that you can show.
When the target in next.config.js
from serverless
to experimental-serverless-trace
, in the resolution of #3575, Netlify build is failing,
throws an error: Cannot find module '@prisma/client'
Netlify Logs:
https://pastebin.com/6bExettA
next.config.js
const { withSentryConfig } = require('@sentry/nextjs');
const moduleExports = {
/* config options here */
target: 'experimental-serverless-trace',
env: {
API_ENDPOINT: process.env.API_ENDPOINT,
},
webpack5: false,
webpack(config, { isServer, dev: isDevelopmentMode }) {
config.module.rules.push({
test: /\.svg$/,
issuer: {
test: /\.(js|ts)x?$/,
},
use: [
{
loader: '@svgr/webpack',
// https://react-svgr.com/docs/options/
},
],
});
config.module.rules.push({
test: /\.po$/,
use: [
{
loader: 'ignore-loader',
},
],
});
// Fixes npm packages that depend on `fs` module
if (!isServer) {
config.node = {
fs: 'empty',
};
}
// Attempt to ignore storybook files when doing a production build,
// see also: https://github.com/vercel/next.js/issues/1914
if (!isDevelopmentMode) {
config.module.rules.push({
test: /\.stories.(js|tsx?)/,
loader: 'ignore-loader',
});
}
return config;
},
poweredByHeader: false,
images: {
domains: ['unsplash.com'],
},
};
const SentryWebpackPluginOptions = {
silent: true,
};
module.exports = withSentryConfig(moduleExports, SentryWebpackPluginOptions);