Title: ESM `require('http')` breaks SSR in SolidStart · Issue #7938 · getsentry/sentry-javascript · GitHub
Open Graph Title: ESM `require('http')` breaks SSR in SolidStart · Issue #7938 · getsentry/sentry-javascript
X Title: ESM `require('http')` breaks SSR in SolidStart · Issue #7938 · getsentry/sentry-javascript
Description: Is there an existing issue for this? I have checked for existing issues https://github.com/getsentry/sentry-javascript/issues I have reviewed the documentation https://docs.sentry.io/ I am using the latest SDK release https://github.com/...
Open Graph Description: Is there an existing issue for this? I have checked for existing issues https://github.com/getsentry/sentry-javascript/issues I have reviewed the documentation https://docs.sentry.io/ I am using th...
X Description: Is there an existing issue for this? I have checked for existing issues https://github.com/getsentry/sentry-javascript/issues I have reviewed the documentation https://docs.sentry.io/ I am using th...
Opengraph URL: https://github.com/getsentry/sentry-javascript/issues/7938
X: @github
Domain: github.com
IPv4 address: 140.82.114.3
{"@context":"https://schema.org","@type":"DiscussionForumPosting","headline":"ESM `require('http')` breaks SSR in SolidStart","articleBody":"### Is there an existing issue for this?\n\n- [X] I have checked for existing issues https://github.com/getsentry/sentry-javascript/issues\n- [X] I have reviewed the documentation https://docs.sentry.io/\n- [X] I am using the latest SDK release https://github.com/getsentry/sentry-javascript/releases\n\n### How do you use Sentry?\n\nSentry Saas (sentry.io)\n\n### Which SDK are you using?\n\n@sentry/node\n\n### SDK Version\n\n7.49.0\n\n### Framework Version\n\nsolid-start version 0.2.26\n\n### Link to Sentry event\n\n_No response_\n\n### SDK Setup\n\n_No response_\n\n### Steps to Reproduce\n\n1. Clone repro https://github.com/jchatard/sentry-solid\r\n2. cd sentry-solid\r\n3. pnpm install\r\n4. pnpm build\r\n5. pnpm start\r\n\r\nI think if you get SvelteKit working, my guess is that Solid Start would almost identical.\r\n\r\nThe work done here: https://github.com/getsentry/sentry-javascript/pull/7377\r\n\r\nWas probably the way to go, but it was reverted.\n\n### Expected Result\n\n1. Application start and is reachable on port 3000\r\n2. The example exception is logged to Sentry.io https://github.com/jchatard/sentry-solid/blob/main/src/entry-server.tsx#L24\n\n### Actual Result\n\nServer won't start with this output:\r\n\r\n```\r\nfile:///Users/jchatard/Desktop/sentry-solid/dist/server.js:26181\r\n const httpModule = require('http');\r\n ^\r\n\r\nReferenceError: require is not defined in ES module scope, you can use import instead\r\nThis file is being treated as an ES module because it has a '.js' file extension and '/Users/jchatard/Desktop/sentry-solid/package.json' contains \"type\": \"module\". To treat it as a CommonJS script, rename it to use the '.cjs' file extension.\r\n at Http.setupOnce (file:///Users/jchatard/Desktop/sentry-solid/dist/server.js:26181:24)\r\n at setupIntegration (file:///Users/jchatard/Desktop/sentry-solid/dist/server.js:21977:17)\r\n at file:///Users/jchatard/Desktop/sentry-solid/dist/server.js:21965:7\r\n at Array.forEach (\u003canonymous>)\r\n at setupIntegrations (file:///Users/jchatard/Desktop/sentry-solid/dist/server.js:21962:16)\r\n at NodeClient.setupIntegrations (file:///Users/jchatard/Desktop/sentry-solid/dist/server.js:22480:28)\r\n at Hub.bindClient (file:///Users/jchatard/Desktop/sentry-solid/dist/server.js:20241:14)\r\n at initAndBind (file:///Users/jchatard/Desktop/sentry-solid/dist/server.js:22946:7)\r\n at init (file:///Users/jchatard/Desktop/sentry-solid/dist/server.js:28588:3)\r\n at file:///Users/jchatard/Desktop/sentry-solid/dist/server.js:30282:1\r\n\r\nNode.js v18.9.0\r\n ELIFECYCLE Command failed with exit code 1\r\n```","author":{"url":"https://github.com/jchatard","@type":"Person","name":"jchatard"},"datePublished":"2023-04-23T17:41:48Z","url":"https://github.com/getsentry/sentry-javascript/issues/7938"}
| 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:a0c94943-421e-2f9e-9601-60c7d878aaa9 |
| current-catalog-service-hash | 81bb79d38c15960b92d99bca9288a9108c7a47b18f2423d0f6438c5b7bcd2114 |
| request-id | E586:2D88C9:F4D7:146DD:6B04AD5F |
| html-safe-nonce | c4de3ba3067b42f9f17accc73007f089098533a45ab8add2b7398bb8396ac865 |
| visitor-payload | eyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiJFNTg2OjJEODhDOTpGNEQ3OjE0NkREOjZCMDRBRDVGIiwidmlzaXRvcl9pZCI6IjUwNjI3NTkxOTY2MzkxNDUzMTEiLCJyZWdpb25fZWRnZSI6ImlhZCIsInJlZ2lvbl9yZW5kZXIiOiJpYWQifQ== |
| visitor-hmac | 63f64c3013e1ba973e632aba4c0afc13085130f8e06dbaa33f8dc374a3ecc74a |
| hovercard-subject-tag | issue:1680107195 |
| 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/7938/issue_layout |
| twitter:image | https://opengraph.githubassets.com/23b763a9ff685a86a053943827b374d09322b1e1c622dbea371412187ad569fc/getsentry/sentry-javascript/issues/7938 |
| twitter:card | summary_large_image |
| og:image | https://opengraph.githubassets.com/23b763a9ff685a86a053943827b374d09322b1e1c622dbea371412187ad569fc/getsentry/sentry-javascript/issues/7938 |
| og:image:alt | Is there an existing issue for this? I have checked for existing issues https://github.com/getsentry/sentry-javascript/issues I have reviewed the documentation https://docs.sentry.io/ I am using th... |
| og:image:width | 1200 |
| og:image:height | 600 |
| og:site_name | GitHub |
| og:type | object |
| og:author:username | jchatard |
| hostname | github.com |
| expected-hostname | github.com |
| None | f1d110ea058a0915c1d8aa3fc2069fa15801e128f591e5762525abe77490ecb1 |
| 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 | ffa22a65e4c46d376940fe34b05e6a7e9c7fdb9b |
| 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