Title: Cannot find module 'cookie' · Issue #3060 · getsentry/sentry-javascript · GitHub
Open Graph Title: Cannot find module 'cookie' · Issue #3060 · getsentry/sentry-javascript
X Title: Cannot find module 'cookie' · Issue #3060 · 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 Package + Version @sentry...
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/3060
X: @github
Domain: github.com
IPv4 address: 140.82.114.4
{"@context":"https://schema.org","@type":"DiscussionForumPosting","headline":"Cannot find module 'cookie'","articleBody":"- [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\r\n## Package + Version\r\n\r\n- [ ] `@sentry/browser`\r\n- [x] `@sentry/node`\r\n- [ ] `raven-js`\r\n- [ ] `raven-node` _(raven for node)_\r\n- [ ] other:\r\n\r\n### Version:\r\n\r\n```\r\n5.27.4\r\nNode v10.21.0\r\n```\r\n\r\n## Description\r\n\r\nI am getting errors because 'cookie' is failing to import. I have multiple dependencies which all depend on cookie and deployment is done via `npm ci` which means that 'cookie' does not end up at the top level of `node_modules`. It only exists within `@sentry/node`. Either `dynamicRequire` is failing to handle a non top level package, or it is failing to handle the fact the cookie dependencies is in `@sentry/node` not `@sentry/utils`.\r\n\r\n```\r\n> require('@sentry/node/node_modules/cookie')\r\n{ parse: [Function: parse], serialize: [Function: serialize] }\r\n> require('cookie')\r\nThrown:\r\n{ Error: Cannot find module 'cookie'\r\n at Function.Module._resolveFilename (internal/modules/cjs/loader.js:636:15)\r\n at Function.Module._load (internal/modules/cjs/loader.js:562:25)\r\n at Module.require (internal/modules/cjs/loader.js:692:17)\r\n at require (internal/modules/cjs/helpers.js:25:18) code: 'MODULE_NOT_FOUND' }\r\n```\r\n\r\n```\r\nroot@b84575c0d6e0:/app# find node_modules/| grep \"/cookie/\"\r\nnode_modules/express/node_modules/cookie/LICENSE\r\nnode_modules/express/node_modules/cookie/package.json\r\nnode_modules/express/node_modules/cookie/HISTORY.md\r\nnode_modules/express/node_modules/cookie/README.md\r\nnode_modules/express/node_modules/cookie/index.js\r\nnode_modules/elastic-apm-node/node_modules/cookie/LICENSE\r\nnode_modules/elastic-apm-node/node_modules/cookie/package.json\r\nnode_modules/elastic-apm-node/node_modules/cookie/HISTORY.md\r\nnode_modules/elastic-apm-node/node_modules/cookie/README.md\r\nnode_modules/elastic-apm-node/node_modules/cookie/index.js\r\nnode_modules/cookie-parser/node_modules/cookie/LICENSE\r\nnode_modules/cookie-parser/node_modules/cookie/package.json\r\nnode_modules/cookie-parser/node_modules/cookie/HISTORY.md\r\nnode_modules/cookie-parser/node_modules/cookie/README.md\r\nnode_modules/cookie-parser/node_modules/cookie/index.js\r\nnode_modules/@sentry/node/node_modules/cookie/LICENSE\r\nnode_modules/@sentry/node/node_modules/cookie/package.json\r\nnode_modules/@sentry/node/node_modules/cookie/HISTORY.md\r\nnode_modules/@sentry/node/node_modules/cookie/README.md\r\nnode_modules/@sentry/node/node_modules/cookie/index.js\r\n```","author":{"url":"https://github.com/kbrownlees","@type":"Person","name":"kbrownlees"},"datePublished":"2020-11-19T01:28:00Z","url":"https://github.com/getsentry/sentry-javascript/issues/3060"}
| 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:30d66b9a-6daa-421e-514b-33682e22997d |
| current-catalog-service-hash | 81bb79d38c15960b92d99bca9288a9108c7a47b18f2423d0f6438c5b7bcd2114 |
| request-id | 9690:14CE41:294451:393713:6B0437EE |
| html-safe-nonce | 09229c96d374b10dd0daf0bdf9b87fa33e7119ebb1b4db48f091745cbb3650f4 |
| visitor-payload | eyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiI5NjkwOjE0Q0U0MToyOTQ0NTE6MzkzNzEzOjZCMDQzN0VFIiwidmlzaXRvcl9pZCI6IjQ2NTg0MzgxOTUyMzM2OTk4MjIiLCJyZWdpb25fZWRnZSI6ImlhZCIsInJlZ2lvbl9yZW5kZXIiOiJpYWQifQ== |
| visitor-hmac | c66111058ea1e8f6f09d2f513987a0e90f05a4fb6a12fcff97fc327d866e52ad |
| hovercard-subject-tag | issue:746169195 |
| 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/3060/issue_layout |
| twitter:image | https://opengraph.githubassets.com/287ee3632ec5b321a613d125e92bdc3aa951a8543738ad5cf69f0db12b0cd716/getsentry/sentry-javascript/issues/3060 |
| twitter:card | summary_large_image |
| og:image | https://opengraph.githubassets.com/287ee3632ec5b321a613d125e92bdc3aa951a8543738ad5cf69f0db12b0cd716/getsentry/sentry-javascript/issues/3060 |
| 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 | kbrownlees |
| hostname | github.com |
| expected-hostname | github.com |
| None | 9185ccfefd80c1ff2d9ddcdb0cd2becf46b5a1efbbf30741a895e4bb8de25e64 |
| 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 | 06dc448a76fe4751ac1db26524aefa3aa3e889a8 |
| 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