Title: Could not resolve './{}' when used with Vite + React · Issue #4473 · getsentry/sentry-javascript · GitHub
Open Graph Title: Could not resolve './{}' when used with Vite + React · Issue #4473 · getsentry/sentry-javascript
X Title: Could not resolve './{}' when used with Vite + React · Issue #4473 · getsentry/sentry-javascript
Description: Review the documentation: https://docs.sentry.io/ Search for existing issues: https://github.com/getsentry/sentry-javascript/issues Use the latest release: https://github.com/getsentry/sentry-javascript/releases Provide a link to the aff...
Open Graph Description: Review the documentation: https://docs.sentry.io/ Search for existing issues: https://github.com/getsentry/sentry-javascript/issues Use the latest release: https://github.com/getsentry/sentry-javas...
X Description: Review the documentation: https://docs.sentry.io/ Search for existing issues: https://github.com/getsentry/sentry-javascript/issues Use the latest release: https://github.com/getsentry/sentry-javas...
Opengraph URL: https://github.com/getsentry/sentry-javascript/issues/4473
X: @github
Domain: github.com
IPv4 address: 140.82.112.4
{"@context":"https://schema.org","@type":"DiscussionForumPosting","headline":"Could not resolve './{}' when used with Vite + React","articleBody":"\u003c!-- Requirements: please go through this checklist before opening a new issue -->\r\n\r\n- [x] Review the documentation: https://docs.sentry.io/\r\n- [x] Search for existing issues: https://github.com/getsentry/sentry-javascript/issues\r\n- [x] Use the latest release: https://github.com/getsentry/sentry-javascript/releases\r\n- [ ] Provide a link to the affected event from your Sentry account\r\n\r\n## Package + Version\r\n\r\n- [ ] `@sentry/browser`\r\n- [ ] `@sentry/node`\r\n- [ ] `raven-js`\r\n- [ ] `raven-node` _(raven for node)_\r\n- [x] other: `@sentry/react`\r\n\r\n### Version:\r\n\r\n```\r\n6.17.3\r\n```\r\n\r\n## Description\r\n\r\nI'm building a React + Typescript project with Vite, and adding Sentry for crash reports and monitoring. When I run the application in dev mode using `vite`, sentry works as expected but I can't build the app using `yarn build` (Which uses `tsc` to compile and then bundles using `vite build`) due to the following error\r\n\r\n\r\nThis is my `vite.config.ts` file\r\n\r\n```typescript\r\nimport { defineConfig } from 'vite'\r\nimport react from '@vitejs/plugin-react'\r\n\r\n// https://vitejs.dev/config/\r\nexport default defineConfig({\r\n build: {\r\n sourcemap: true\r\n },\r\n define: {\r\n global: {}\r\n },\r\n plugins: [react()]\r\n})\r\n```\r\n\r\nI do not face this issue with other modules, downgrading `@sentry/react` doesn't seem to help\r\n\r\n","author":{"url":"https://github.com/mukul-mehta","@type":"Person","name":"mukul-mehta"},"datePublished":"2022-01-31T18:54:54Z","url":"https://github.com/getsentry/sentry-javascript/issues/4473"}
| 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:edf06b9a-8b18-5e8e-7ef4-522c22693a0e |
| current-catalog-service-hash | 81bb79d38c15960b92d99bca9288a9108c7a47b18f2423d0f6438c5b7bcd2114 |
| request-id | E28E:329C7F:65329A:8A2564:6B047585 |
| html-safe-nonce | 76361b27baac15fdeb075a1c53efc8fe32a392a59094839036d45ce8002b5c0b |
| visitor-payload | eyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiJFMjhFOjMyOUM3Rjo2NTMyOUE6OEEyNTY0OjZCMDQ3NTg1IiwidmlzaXRvcl9pZCI6IjEwMjE3MzM3NDAzOTA2NzU4NDUiLCJyZWdpb25fZWRnZSI6ImlhZCIsInJlZ2lvbl9yZW5kZXIiOiJpYWQifQ== |
| visitor-hmac | f9fdc52ed2aa0928a71ae30b07ce22ce6ba7e632f4776814774d7a0a0cb245ab |
| hovercard-subject-tag | issue:1119808604 |
| 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/4473/issue_layout |
| twitter:image | https://opengraph.githubassets.com/361574bf73173bd440d7972b36d99e7ff23cb770540698edd52a9e27dbd7df78/getsentry/sentry-javascript/issues/4473 |
| twitter:card | summary_large_image |
| og:image | https://opengraph.githubassets.com/361574bf73173bd440d7972b36d99e7ff23cb770540698edd52a9e27dbd7df78/getsentry/sentry-javascript/issues/4473 |
| og:image:alt | Review the documentation: https://docs.sentry.io/ Search for existing issues: https://github.com/getsentry/sentry-javascript/issues Use the latest release: https://github.com/getsentry/sentry-javas... |
| og:image:width | 1200 |
| og:image:height | 600 |
| og:site_name | GitHub |
| og:type | object |
| og:author:username | mukul-mehta |
| hostname | github.com |
| expected-hostname | github.com |
| None | 9c099f1b85def81ca352464c276510dfef32deaf3c305404e65b8d270284a58b |
| 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 | cf73f57448d52b3a7b619195e182b33d3b3454ca |
| 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