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

script 404 with withPlausibleProxy #130

Open
lucky13820 opened this issue Sep 23, 2024 · 0 comments
Open

script 404 with withPlausibleProxy #130

lucky13820 opened this issue Sep 23, 2024 · 0 comments

Comments

@lucky13820
Copy link

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.

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