Closed
Description
Environment
SaaS (https://sentry.io/)
Version
No response
Link
No response
DSN
No response
Steps to Reproduce
I've installed sentry on my Next.js project. I'm trying to use require.context
like so:
const flagImages = importAll(
require.context("../../public/images/flags", false, /\.(png|jpe?g|svg)$/)
);
This was working fine before installing sentry, but doesn't work after installing sentry. I assume the reason it no longer works is because sentry changes the webpack configuration.
I tried using import.meta.webpackContext
as the ESM alternative to require.context
, but this didn't work either - I just get import.meta.webpackContext
is undefined.
Expected Result
Should be able to use require.context
or import.meta.webpackContext