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

Sentry plugin + vite bundler crashing admin panel #6159

Open
razvan-soare opened this issue Apr 30, 2024 · 0 comments
Open

Sentry plugin + vite bundler crashing admin panel #6159

razvan-soare opened this issue Apr 30, 2024 · 0 comments
Labels
[possible-bug] Possible bug which hasn't been reproduced yet

Comments

@razvan-soare
Copy link

Link to reproduction

https://github.com/razvan-soare/payload-sentry-bug-rep

Describe the Bug

Accessing admin panel page will only show a white screen and throw an error:
Error: Dynamic require of "../../../../../../../@payloadcms+plugin-sentry@0.0.6_payload@2.14.2_@types+react@18.3.1_esbuild@0.19.12_typescript_dqcizn726yaibqtjwknlnrbrrm/node_modules/@payloadcms/plugin-sentry/dist/captureException" is not supported

Screenshot 2024-05-01 at 00 10 34

To Reproduce

Clone the repo i linked or:

Create new payload project:

npx create-payload-app@latest --use-pnpm
✔ Project name? … payload-sentry-bug-rep
✔ Choose project template › blank
✔ Select a database › PostgreSQL (beta)
✔ Enter PostgreSQL connection string … postgres://127.0.0.1:5432/payload-sentry-bug-rep

Install viteBundler and sentry

np i @payloadcms/bundler-vite
np i @payloadcms/plugin-sentry

Add them in payload.config.ts:

 admin: {
    bundler: viteBundler(),
  },
  plugins: [
    sentry({
      dsn: process.env.SENTRY_DSN,
      options: {
        init: {
          debug: true,
          environment: 'development',
          tracesSampleRate: 1.0,
        },
        requestHandler: {
          serverName: false,
          user: ['email'],
        },
        captureErrors: [400, 403, 404],
      },
    }),
  ],

Start the project and go check http://localhost:3000/admin/

Payload Version

"payload": "^2.0.0"

Adapters and Plugins

sentry-plugin, db-postgres, bundler-vite

@razvan-soare razvan-soare added the [possible-bug] Possible bug which hasn't been reproduced yet label Apr 30, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
[possible-bug] Possible bug which hasn't been reproduced yet
Projects
None yet
Development

No branches or pull requests

1 participant