Title: Require.context not working after installing sentry on Next.js project · Issue #6961 · getsentry/sentry-javascript · GitHub
Open Graph Title: Require.context not working after installing sentry on Next.js project · Issue #6961 · getsentry/sentry-javascript
X Title: Require.context not working after installing sentry on Next.js project · Issue #6961 · getsentry/sentry-javascript
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.c...
Open Graph 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:...
X 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 ...
Opengraph URL: https://github.com/getsentry/sentry-javascript/issues/6961
X: @github
Domain: github.com
IPv4 address: 140.82.112.3
{"@context":"https://schema.org","@type":"DiscussionForumPosting","headline":"Require.context not working after installing sentry on Next.js project","articleBody":"### Environment\n\nSaaS (https://sentry.io/)\n\n### Version\n\n_No response_\n\n### Link\n\n_No response_\n\n### DSN\n\n_No response_\n\n### Steps to Reproduce\n\nI've installed sentry on my Next.js project. I'm trying to use `require.context` like so:\r\n\r\n```\r\nconst flagImages = importAll(\r\n require.context(\"../../public/images/flags\", false, /\\.(png|jpe?g|svg)$/)\r\n);\r\n```\r\nThis 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.\r\n\r\nI 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.\n\n### Expected Result\n\nShould be able to use `require.context` or `import.meta.webpackContext`\n\n### Actual Result\n\n\u003cimg width=\"947\" alt=\"image\" src=\"https://user-images.githubusercontent.com/108180338/215127744-51103a88-ac18-45d5-a60f-5455ece70616.png\">\r\n","author":{"url":"https://github.com/dorianw123","@type":"Person","name":"dorianw123"},"datePublished":"2023-01-27T15:47:42Z","url":"https://github.com/getsentry/sentry-javascript/issues/6961"}
| react-profiling | 0 |
| react-import-map | react,react-dom,react-dom/client,react-dom/profiling,react-is,react/compiler-runtime,react/jsx-dev-runtime,react/jsx-runtime,scheduler@b8488ee2c322 |
| route-pattern | /_view_fragments/issues/show/:user_id/:repository/:id/issue_layout(.:format) |
| route-controller | voltron_issues_fragments |
| route-action | issue_layout |
| fetch-nonce | v2:63dbdf55-46b3-cf1a-b9f6-f3a198b02b59 |
| current-catalog-service-hash | 81bb79d38c15960b92d99bca9288a9108c7a47b18f2423d0f6438c5b7bcd2114 |
| request-id | D45A:D7239:7C6789:AF12A3:6B0481D6 |
| html-safe-nonce | 0d62e103c19beef616b28e92e69d83a98eab0601eab33684224375955adf66f9 |
| visitor-payload | eyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiJENDVBOkQ3MjM5OjdDNjc4OTpBRjEyQTM6NkIwNDgxRDYiLCJ2aXNpdG9yX2lkIjoiNjI4MDIzOTE0NDk0NjEzOTYwNiIsInJlZ2lvbl9lZGdlIjoiaWFkIiwicmVnaW9uX3JlbmRlciI6ImlhZCJ9 |
| visitor-hmac | 80611cf9fd20b7c1f92ee90f4f9c4b5ecc872ec8b3e33dd00cb1b3f008d5f1eb |
| hovercard-subject-tag | issue:1560354725 |
| github-keyboard-shortcuts | repository,issues,copilot |
| google-site-verification | Apib7-x98H0j5cPqHWwSMm6dNU4GmODRoqxLiDzdx9I |
| octolytics-url | https://collector.github.com/github/collect |
| analytics-location | / |
| fb:app_id | 1401488693436528 |
| apple-itunes-app | app-id=1477376905, app-argument=https://github.com/_view_fragments/issues/show/getsentry/sentry-javascript/6961/issue_layout |
| twitter:image | https://opengraph.githubassets.com/7210cdc8483475ba62394ed5096ffdb28a87c54a7c59bf0f5da2d0afb55dcf00/getsentry/sentry-javascript/issues/6961 |
| twitter:card | summary_large_image |
| og:image | https://opengraph.githubassets.com/7210cdc8483475ba62394ed5096ffdb28a87c54a7c59bf0f5da2d0afb55dcf00/getsentry/sentry-javascript/issues/6961 |
| og:image:alt | 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:... |
| og:image:width | 1200 |
| og:image:height | 600 |
| og:site_name | GitHub |
| og:type | object |
| og:author:username | dorianw123 |
| hostname | github.com |
| expected-hostname | github.com |
| None | 0366ddfb372682a32e92a5d86155cb08fa83e5bbe79953a968789f2f7e24c511 |
| turbo-cache-control | no-preview |
| go-import | github.com/getsentry/sentry-javascript git https://github.com/getsentry/sentry-javascript.git |
| octolytics-dimension-user_id | 1396951 |
| octolytics-dimension-user_login | getsentry |
| octolytics-dimension-repository_id | 3328572 |
| octolytics-dimension-repository_nwo | getsentry/sentry-javascript |
| octolytics-dimension-repository_public | true |
| octolytics-dimension-repository_is_fork | false |
| octolytics-dimension-repository_network_root_id | 3328572 |
| octolytics-dimension-repository_network_root_nwo | getsentry/sentry-javascript |
| turbo-body-classes | logged-out env-production page-responsive |
| disable-turbo | false |
| browser-stats-url | https://api.github.com/_private/browser/stats |
| browser-errors-url | https://api.github.com/_private/browser/errors |
| release | ed3f2e01f6b7672780c586c8af0e72726374d7b6 |
| ui-target | full |
| theme-color | #1e2327 |
| color-scheme | light dark |
| react-app-name | issues |
Links:
| Server | github.com |
| Content-Type | text/html; charset=utf-8 |
| Cache-Control | max-age=0, private, must-revalidate |
Viewport: width=device-width