Next.js Discord

Discord Forum

Turbopack source-maps

Unanswered
Sun bear posted this in #help-forum
Open in Discord
Sun bearOP
Not getting the right

With turbo (pnpm dev --turbo)
![Screenshot 2025-06-04 at 11 29 58 AM](https://github.com/user-attachments/assets/6bfcb55f-2168-4c3b-85ed-77fa978114f8)

Without turbo (pnpm dev):
![Screenshot 2025-06-04 at 11 31 51 AM](https://github.com/user-attachments/assets/a4ae35c6-3f56-4528-9523-9b112d2551ec)

When I use turbo I am not getting the right component, only the bundled version.

Current next.config:

/** @type {import('next').NextConfig} */
const nextConfig = {
  experimental: {
    serverActions: {
      bodySizeLimit: '100mb', // Bump body size limit to 100 in order to send very large orders via email (TODO: upload them in the future)
    },
    // https://community.vercel.com/t/troubleshooting-builds-failing-with-sigkill-or-out-of-memory-errors/156
    webpackBuildWorker: true,
  },
  eslint: {
    ignoreDuringBuilds: true,
  },
  typescript: {
    ignoreBuildErrors: true,
  },
  env: {
    NEXT_PUBLIC_SENTRY_RELEASE: process.env.NEXT_PUBLIC_SENTRY_RELEASE,
  },
  // Memory optimization
  productionBrowserSourceMaps: true,
  webpack: (config, { dev, isServer }) => {
    if (config.cache && !dev) {
      config.cache = Object.freeze({
        type: 'memory',
      });
    }

    if (isServer) {
      config.devtool = 'source-map';
    }

    // Important: return the modified config
    return config;
  },

  // PostHog rewrites to avoid ad-blockers
  async rewrites() {
    return [
      {
        source: '/ingest/static/:path*',
        destination: 'https://us-assets.i.posthog.com/static/:path*',
      },
      {
        source: '/ingest/:path*',
        destination: 'https://us.i.posthog.com/:path*',
      },
      {
        source: '/ingest/decide',
        destination: 'https://us.i.posthog.com/decide',
      },
    ];
  },
  // This is required to support PostHog trailing slash API requests
  skipTrailingSlashRedirect: true,
};

0 Replies