Skip to content

script 404 with withPlausibleProxy #130

@lucky13820

Description

@lucky13820
import "./src/env.mjs";
import { withSentryConfig } from "@sentry/nextjs";
import { withPlausibleProxy } from "next-plausible";
import withBundleAnalyzer from "@next/bundle-analyzer";

const bundleAnalyzer = withBundleAnalyzer({
  enabled: process.env.ANALYZE === "true",
});

/** @type {import('next').NextConfig} */
const nextConfig = {
  experimental: {
    instrumentationHook: process.env.NODE_ENV === "production",
  },
  compress: true, // Enable gzip compression
};

// Apply bundleAnalyzer first
const configWithBundle = bundleAnalyzer(nextConfig);

// Then apply withPlausibleProxy to the bundled config
const configWithPlausible = withPlausibleProxy(configWithBundle);

// Finally, wrap withSentryConfig to include Sentry settings
export default withSentryConfig(configWithPlausible, {
  silent: !process.env.CI,
  telemetry: false,
  widenClientFileUpload: true,
  hideSourceMaps: true,
  disableLogger: true,
  tunnelRoute: "/monitoring",
});

With my current next config, when I visit http://localhost:3000/js/script.js, it would just show a 404 page. I tried to remove sentry config and only leave Plausible Proxy, still doesn't work, I couldn't figure out why that's the case.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions