Title: ReferenceError: document is not defined · Issue #5243 · plotly/plotly.js · GitHub
Open Graph Title: ReferenceError: document is not defined · Issue #5243 · plotly/plotly.js
X Title: ReferenceError: document is not defined · Issue #5243 · plotly/plotly.js
Description: This dependency makes it impossible to use plotly.js in the browser because image-size uses fs module which is not available in browsers. I do not know how does react-plotly.js adapt to this dependency but I guess they have this issue to...
Open Graph Description: This dependency makes it impossible to use plotly.js in the browser because image-size uses fs module which is not available in browsers. I do not know how does react-plotly.js adapt to this depend...
X Description: This dependency makes it impossible to use plotly.js in the browser because image-size uses fs module which is not available in browsers. I do not know how does react-plotly.js adapt to this depend...
Opengraph URL: https://github.com/plotly/plotly.js/issues/5243
X: @github
Domain: github.com
{"@context":"https://schema.org","@type":"DiscussionForumPosting","headline":"ReferenceError: document is not defined","articleBody":"This dependency makes it impossible to use plotly.js in the browser because image-size uses fs module which is not available in browsers. I do not know how does react-plotly.js adapt to this dependency but I guess they have this issue too.\r\n\r\nRelated to: https://github.com/plotly/plotly.js/pull/5119.\r\n\r\n# Reproducible example\r\n1. Create an app with `create-react-app`.\r\n2. Install dependencies from the screenshot below (you might need to change the React and ReactDOM packages' versions too), including `plotly.js@1.57.1` and use it as a dynamic import with `@loadable/component`.\r\n3. Run `yarn start` in the project directory.\r\n\r\n## Screenshot\r\n\r\n\r\n## Expected output\r\nThe app runs well without terminal or browser errors.\r\n\r\n## Actual output\r\nError inside browser window:\r\n\r\n\r\n\r\n# Update\r\nThe essence of this issue is here: https://github.com/plotly/plotly.js/issues/5243#issuecomment-724028727","author":{"url":"https://github.com/silviubogan","@type":"Person","name":"silviubogan"},"datePublished":"2020-11-03T16:53:12.000Z","interactionStatistic":{"@type":"InteractionCounter","interactionType":"https://schema.org/CommentAction","userInteractionCount":17},"url":"https://github.com/5243/plotly.js/issues/5243"}
| 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:47f95b43-f5bf-110f-d087-13f27697f597 |
| current-catalog-service-hash | 81bb79d38c15960b92d99bca9288a9108c7a47b18f2423d0f6438c5b7bcd2114 |
| request-id | CD12:10F38A:445244:5A7D1E:6A5B29DA |
| html-safe-nonce | c21c31a0c6043ccf2ea03c355b8c7c1192a0d6584fb7c487a53fba0545caa758 |
| visitor-payload | eyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiJDRDEyOjEwRjM4QTo0NDUyNDQ6NUE3RDFFOjZBNUIyOURBIiwidmlzaXRvcl9pZCI6IjcyMTY0NDY3NzAyNjgyODU0MDIiLCJyZWdpb25fZWRnZSI6ImlhZCIsInJlZ2lvbl9yZW5kZXIiOiJpYWQifQ== |
| visitor-hmac | bd9dc1f73992de339bab2fe4a99be1b6b8d02a690db9053f4ba01462e5995a3e |
| hovercard-subject-tag | issue:735483183 |
| 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/plotly/plotly.js/5243/issue_layout |
| twitter:image | https://opengraph.githubassets.com/2d802075919f672533aadbd2ba63f443f0b545549712854e18f820634db215c6/plotly/plotly.js/issues/5243 |
| twitter:card | summary_large_image |
| og:image | https://opengraph.githubassets.com/2d802075919f672533aadbd2ba63f443f0b545549712854e18f820634db215c6/plotly/plotly.js/issues/5243 |
| og:image:alt | This dependency makes it impossible to use plotly.js in the browser because image-size uses fs module which is not available in browsers. I do not know how does react-plotly.js adapt to this depend... |
| og:image:width | 1200 |
| og:image:height | 600 |
| og:site_name | GitHub |
| og:type | object |
| og:author:username | silviubogan |
| hostname | github.com |
| expected-hostname | github.com |
| None | 5290d7e14309ad1e76106a9c4237bd1041517e83ea182c8ab756752cb0c6940b |
| turbo-cache-control | no-preview |
| go-import | github.com/plotly/plotly.js git https://github.com/plotly/plotly.js.git |
| octolytics-dimension-user_id | 5997976 |
| octolytics-dimension-user_login | plotly |
| octolytics-dimension-repository_id | 45646037 |
| octolytics-dimension-repository_nwo | plotly/plotly.js |
| octolytics-dimension-repository_public | true |
| octolytics-dimension-repository_is_fork | false |
| octolytics-dimension-repository_network_root_id | 45646037 |
| octolytics-dimension-repository_network_root_nwo | plotly/plotly.js |
| 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 | 9c975978430e9ad293956f2bbdaf153b1bd84a99 |
| ui-target | full |
| theme-color | #1e2327 |
| color-scheme | light dark |
Links:
Viewport: width=device-width