Skip to content
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

Netlify build failing if target in next.config.js changed to experimental-serverless-trace #3931

Closed
1 of 9 tasks
ani4aniket opened this issue Aug 29, 2021 · 0 comments
Closed
1 of 9 tasks

Comments

@ani4aniket
Copy link

ani4aniket commented Aug 29, 2021

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, 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);
@ani4aniket ani4aniket changed the title Netlify build failing if target in next.config.js changed to experimental-serverless-trace Netlify build failing if target in next.config.js changed to experimental-serverless-trace Aug 29, 2021
@ani4aniket ani4aniket changed the title Netlify build failing if target in next.config.js changed to experimental-serverless-trace Netlify build failing if target in next.config.js changed to experimental-serverless-trace Aug 29, 2021
@ani4aniket ani4aniket changed the title Netlify build failing if target in next.config.js changed to experimental-serverless-trace Netlify build failing if target in next.config.js changed to experimental-serverless-trace Aug 29, 2021
@ani4aniket ani4aniket changed the title Netlify build failing if target in next.config.js changed to experimental-serverless-trace Netlify build failing if target in next.config.js changed to experimental-serverless-trace Aug 29, 2021
@ani4aniket ani4aniket changed the title Netlify build failing if target in next.config.js changed to experimental-serverless-trace Netlify build failing if target in next.config.js changed to experimental-serverless-trace Aug 29, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant