{"action":"created","issue":{"url":"https://api.github.com/repos/canvg/canvg/issues/583","repository_url":"https://api.github.com/repos/canvg/canvg","labels_url":"https://api.github.com/repos/canvg/canvg/issues/583/labels{/name}","comments_url":"https://api.github.com/repos/canvg/canvg/issues/583/comments","events_url":"https://api.github.com/repos/canvg/canvg/issues/583/events","html_url":"https://github.com/canvg/canvg/issues/583","id":335099064,"node_id":"MDU6SXNzdWUzMzUwOTkwNjQ=","number":583,"title":"Using canvg in React project gives a compile error","user":{"login":"vijayst","id":3457565,"node_id":"MDQ6VXNlcjM0NTc1NjU=","avatar_url":"https://avatars0.githubusercontent.com/u/3457565?v=4","gravatar_id":"","url":"https://api.github.com/users/vijayst","html_url":"https://github.com/vijayst","followers_url":"https://api.github.com/users/vijayst/followers","following_url":"https://api.github.com/users/vijayst/following{/other_user}","gists_url":"https://api.github.com/users/vijayst/gists{/gist_id}","starred_url":"https://api.github.com/users/vijayst/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/vijayst/subscriptions","organizations_url":"https://api.github.com/users/vijayst/orgs","repos_url":"https://api.github.com/users/vijayst/repos","events_url":"https://api.github.com/users/vijayst/events{/privacy}","received_events_url":"https://api.github.com/users/vijayst/received_events","type":"User","site_admin":false},"labels":[],"state":"closed","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":5,"created_at":"2018-06-23T13:03:11Z","updated_at":"2018-08-10T21:33:17Z","closed_at":"2018-08-10T21:33:17Z","author_association":"NONE","body":"I am using canvg in a React project. \r\n\r\n```\r\nyarn add canvg\r\nimport canvg from 'canvg';\r\n```\r\n\r\nIt gives a compile error.\r\n\r\n> ERROR in ./node_modules/jsdom/lib/jsdom/living/xmlhttprequest.js\r\n> Module not found: Error: Can't resolve 'child_process' in '/Users/vijayst/Documents/react/dandi/dandi-ui/node_modules/jsdom/lib/jsdom/living'\r\n>  @ ./node_modules/jsdom/lib/jsdom/living/xmlhttprequest.js 4:18-42\r\n>  @ ./node_modules/jsdom/lib/jsdom/browser/Window.js\r\n>  @ ./node_modules/jsdom/lib/jsdom.js\r\n>  @ ./node_modules/canvg/canvg.js\r\n>  @ ./src/reports/SummaryWidget.js\r\n>  @ ./src/comp/Summary.js\r\n>  @ ./src/layout/Routes.js\r\n>  @ ./src/Main.js\r\n>  @ ./src/App.js\r\n>  @ multi (webpack)-dev-server/client?http://localhost:8080 webpack/hot/dev-server react-hot-loader/patch webpack/hot/only-dev-server ./src/App.js\r\n> \r\n> ERROR in ./node_modules/cssstyle/lib/CSSStyleDeclaration.js\r\n> Module not found: Error: Can't resolve 'fs' in '/Users/vijayst/Documents/react/dandi/dandi-ui/node_modules/cssstyle/lib'\r\n>  @ ./node_modules/cssstyle/lib/CSSStyleDeclaration.js 7:9-22\r\n>  @ ./node_modules/jsdom/lib/jsdom/level2/style.js\r\n>  @ ./node_modules/jsdom/lib/jsdom/living/index.js\r\n>  @ ./node_modules/jsdom/lib/jsdom.js\r\n>  @ ./node_modules/canvg/canvg.js\r\n>  @ ./src/reports/SummaryWidget.js\r\n>  @ ./src/comp/Summary.js\r\n>  @ ./src/layout/Routes.js\r\n>  @ ./src/Main.js\r\n>  @ ./src/App.js\r\n>  @ multi (webpack)-dev-server/client?http://localhost:8080 webpack/hot/dev-server react-hot-loader/patch webpack/hot/only-dev-server ./src/App.js\r\n> \r\n> ERROR in ./node_modules/jsdom/lib/jsdom.js\r\n> Module not found: Error: Can't resolve 'fs' in '/Users/vijayst/Documents/react/dandi/dandi-ui/node_modules/jsdom/lib'\r\n>  @ ./node_modules/jsdom/lib/jsdom.js 6:11-24\r\n>  @ ./node_modules/canvg/canvg.js\r\n>  @ ./src/reports/SummaryWidget.js\r\n>  @ ./src/comp/Summary.js\r\n>  @ ./src/layout/Routes.js\r\n>  @ ./src/Main.js\r\n>  @ ./src/App.js\r\n>  @ multi (webpack)-dev-server/client?http://localhost:8080 webpack/hot/dev-server react-hot-loader/patch webpack/hot/only-dev-server ./src/App.js\r\n> \r\n> ERROR in ./node_modules/jsdom/lib/jsdom/browser/resource-loader.js\r\n> Module not found: Error: Can't resolve 'fs' in '/Users/vijayst/Documents/react/dandi/dandi-ui/node_modules/jsdom/lib/jsdom/browser'\r\n>  @ ./node_modules/jsdom/lib/jsdom/browser/resource-loader.js 7:11-24\r\n>  @ ./node_modules/jsdom/lib/jsdom/living/nodes/Document-impl.js\r\n>  @ ./node_modules/jsdom/lib/jsdom/living/node-iterator.js\r\n>  @ ./node_modules/jsdom/lib/jsdom/living/index.js\r\n>  @ ./node_modules/jsdom/lib/jsdom.js\r\n>  @ ./node_modules/canvg/canvg.js\r\n>  @ ./src/reports/SummaryWidget.js\r\n>  @ ./src/comp/Summary.js\r\n>  @ ./src/layout/Routes.js\r\n>  @ ./src/Main.js\r\n>  @ ./src/App.js\r\n>  @ multi (webpack)-dev-server/client?http://localhost:8080 webpack/hot/dev-server react-hot-loader/patch webpack/hot/only-dev-server ./src/App.js\r\n> \r\n> ERROR in ./node_modules/jsdom/lib/jsdom/living/xhr-utils.js\r\n> Module not found: Error: Can't resolve 'fs' in '/Users/vijayst/Documents/react/dandi/dandi-ui/node_modules/jsdom/lib/jsdom/living'\r\n>  @ ./node_modules/jsdom/lib/jsdom/living/xhr-utils.js 5:11-24\r\n>  @ ./node_modules/jsdom/lib/jsdom/living/xmlhttprequest.js\r\n>  @ ./node_modules/jsdom/lib/jsdom/browser/Window.js\r\n>  @ ./node_modules/jsdom/lib/jsdom.js\r\n>  @ ./node_modules/canvg/canvg.js\r\n>  @ ./src/reports/SummaryWidget.js\r\n>  @ ./src/comp/Summary.js\r\n>  @ ./src/layout/Routes.js\r\n>  @ ./src/Main.js\r\n>  @ ./src/App.js\r\n>  @ multi (webpack)-dev-server/client?http://localhost:8080 webpack/hot/dev-server react-hot-loader/patch webpack/hot/only-dev-server ./src/App.js\r\n> \r\n> ERROR in ./node_modules/jsdom/node_modules/request/lib/har.js\r\n> Module not found: Error: Can't resolve 'fs' in '/Users/vijayst/Documents/react/dandi/dandi-ui/node_modules/jsdom/node_modules/request/lib'\r\n>  @ ./node_modules/jsdom/node_modules/request/lib/har.js 3:9-22\r\n>  @ ./node_modules/jsdom/node_modules/request/request.js\r\n>  @ ./node_modules/jsdom/node_modules/request/index.js\r\n>  @ ./node_modules/jsdom/lib/jsdom/browser/resource-loader.js\r\n>  @ ./node_modules/jsdom/lib/jsdom/living/nodes/Document-impl.js\r\n>  @ ./node_modules/jsdom/lib/jsdom/living/node-iterator.js\r\n>  @ ./node_modules/jsdom/lib/jsdom/living/index.js\r\n>  @ ./node_modules/jsdom/lib/jsdom.js\r\n>  @ ./node_modules/canvg/canvg.js\r\n>  @ ./src/reports/SummaryWidget.js\r\n>  @ ./src/comp/Summary.js\r\n>  @ ./src/layout/Routes.js\r\n>  @ ./src/Main.js\r\n>  @ ./src/App.js\r\n>  @ multi (webpack)-dev-server/client?http://localhost:8080 webpack/hot/dev-server react-hot-loader/patch webpack/hot/only-dev-server ./src/App.js\r\n> \r\n> ERROR in ./node_modules/forever-agent/index.js\r\n> Module not found: Error: Can't resolve 'net' in '/Users/vijayst/Documents/react/dandi/dandi-ui/node_modules/forever-agent'\r\n>  @ ./node_modules/forever-agent/index.js 6:10-24\r\n>  @ ./node_modules/jsdom/node_modules/request/request.js\r\n>  @ ./node_modules/jsdom/node_modules/request/index.js\r\n>  @ ./node_modules/jsdom/lib/jsdom/browser/resource-loader.js\r\n>  @ ./node_modules/jsdom/lib/jsdom/living/nodes/Document-impl.js\r\n>  @ ./node_modules/jsdom/lib/jsdom/living/node-iterator.js\r\n>  @ ./node_modules/jsdom/lib/jsdom/living/index.js\r\n>  @ ./node_modules/jsdom/lib/jsdom.js\r\n>  @ ./node_modules/canvg/canvg.js\r\n>  @ ./src/reports/SummaryWidget.js\r\n>  @ ./src/comp/Summary.js\r\n>  @ ./src/layout/Routes.js\r\n>  @ ./src/Main.js\r\n>  @ ./src/App.js\r\n>  @ multi (webpack)-dev-server/client?http://localhost:8080 webpack/hot/dev-server react-hot-loader/patch webpack/hot/only-dev-server ./src/App.js\r\n> \r\n> ERROR in ./node_modules/jsdom/node_modules/request/node_modules/tough-cookie/lib/cookie.js\r\n> Module not found: Error: Can't resolve 'net' in '/Users/vijayst/Documents/react/dandi/dandi-ui/node_modules/jsdom/node_modules/request/node_modules/tough-cookie/lib'\r\n>  @ ./node_modules/jsdom/node_modules/request/node_modules/tough-cookie/lib/cookie.js 32:10-24\r\n>  @ ./node_modules/jsdom/node_modules/request/lib/cookies.js\r\n>  @ ./node_modules/jsdom/node_modules/request/index.js\r\n>  @ ./node_modules/jsdom/lib/jsdom/browser/resource-loader.js\r\n>  @ ./node_modules/jsdom/lib/jsdom/living/nodes/Document-impl.js\r\n>  @ ./node_modules/jsdom/lib/jsdom/living/node-iterator.js\r\n>  @ ./node_modules/jsdom/lib/jsdom/living/index.js\r\n>  @ ./node_modules/jsdom/lib/jsdom.js\r\n>  @ ./node_modules/canvg/canvg.js\r\n>  @ ./src/reports/SummaryWidget.js\r\n>  @ ./src/comp/Summary.js\r\n>  @ ./src/layout/Routes.js\r\n>  @ ./src/Main.js\r\n>  @ ./src/App.js\r\n>  @ multi (webpack)-dev-server/client?http://localhost:8080 webpack/hot/dev-server react-hot-loader/patch webpack/hot/only-dev-server ./src/App.js\r\n> \r\n> ERROR in ./node_modules/jsdom/node_modules/tough-cookie/lib/cookie.js\r\n> Module not found: Error: Can't resolve 'net' in '/Users/vijayst/Documents/react/dandi/dandi-ui/node_modules/jsdom/node_modules/tough-cookie/lib'\r\n>  @ ./node_modules/jsdom/node_modules/tough-cookie/lib/cookie.js 32:10-24\r\n>  @ ./node_modules/jsdom/lib/jsdom/living/nodes/Document-impl.js\r\n>  @ ./node_modules/jsdom/lib/jsdom/living/node-iterator.js\r\n>  @ ./node_modules/jsdom/lib/jsdom/living/index.js\r\n>  @ ./node_modules/jsdom/lib/jsdom.js\r\n>  @ ./node_modules/canvg/canvg.js\r\n>  @ ./src/reports/SummaryWidget.js\r\n>  @ ./src/comp/Summary.js\r\n>  @ ./src/layout/Routes.js\r\n>  @ ./src/Main.js\r\n>  @ ./src/App.js\r\n>  @ multi (webpack)-dev-server/client?http://localhost:8080 webpack/hot/dev-server react-hot-loader/patch webpack/hot/only-dev-server ./src/App.js\r\n> \r\n> ERROR in ./node_modules/tunnel-agent/index.js\r\n> Module not found: Error: Can't resolve 'net' in '/Users/vijayst/Documents/react/dandi/dandi-ui/node_modules/tunnel-agent'\r\n>  @ ./node_modules/tunnel-agent/index.js 3:10-24\r\n>  @ ./node_modules/jsdom/node_modules/request/lib/tunnel.js\r\n>  @ ./node_modules/jsdom/node_modules/request/request.js\r\n>  @ ./node_modules/jsdom/node_modules/request/index.js\r\n>  @ ./node_modules/jsdom/lib/jsdom/browser/resource-loader.js\r\n>  @ ./node_modules/jsdom/lib/jsdom/living/nodes/Document-impl.js\r\n>  @ ./node_modules/jsdom/lib/jsdom/living/node-iterator.js\r\n>  @ ./node_modules/jsdom/lib/jsdom/living/index.js\r\n>  @ ./node_modules/jsdom/lib/jsdom.js\r\n>  @ ./node_modules/canvg/canvg.js\r\n>  @ ./src/reports/SummaryWidget.js\r\n>  @ ./src/comp/Summary.js\r\n>  @ ./src/layout/Routes.js\r\n>  @ ./src/Main.js\r\n>  @ ./src/App.js\r\n>  @ multi (webpack)-dev-server/client?http://localhost:8080 webpack/hot/dev-server react-hot-loader/patch webpack/hot/only-dev-server ./src/App.js\r\n> \r\n> ERROR in ./node_modules/forever-agent/index.js\r\n> Module not found: Error: Can't resolve 'tls' in '/Users/vijayst/Documents/react/dandi/dandi-ui/node_modules/forever-agent'\r\n>  @ ./node_modules/forever-agent/index.js 7:10-24\r\n>  @ ./node_modules/jsdom/node_modules/request/request.js\r\n>  @ ./node_modules/jsdom/node_modules/request/index.js\r\n>  @ ./node_modules/jsdom/lib/jsdom/browser/resource-loader.js\r\n>  @ ./node_modules/jsdom/lib/jsdom/living/nodes/Document-impl.js\r\n>  @ ./node_modules/jsdom/lib/jsdom/living/node-iterator.js\r\n>  @ ./node_modules/jsdom/lib/jsdom/living/index.js\r\n>  @ ./node_modules/jsdom/lib/jsdom.js\r\n>  @ ./node_modules/canvg/canvg.js\r\n>  @ ./src/reports/SummaryWidget.js\r\n>  @ ./src/comp/Summary.js\r\n>  @ ./src/layout/Routes.js\r\n>  @ ./src/Main.js\r\n>  @ ./src/App.js\r\n>  @ multi (webpack)-dev-server/client?http://localhost:8080 webpack/hot/dev-server react-hot-loader/patch webpack/hot/only-dev-server ./src/App.js\r\n> \r\n> ERROR in ./node_modules/tunnel-agent/index.js\r\n> Module not found: Error: Can't resolve 'tls' in '/Users/vijayst/Documents/react/dandi/dandi-ui/node_modules/tunnel-agent'\r\n>  @ ./node_modules/tunnel-agent/index.js 4:10-24\r\n>  @ ./node_modules/jsdom/node_modules/request/lib/tunnel.js\r\n>  @ ./node_modules/jsdom/node_modules/request/request.js\r\n>  @ ./node_modules/jsdom/node_modules/request/index.js\r\n>  @ ./node_modules/jsdom/lib/jsdom/browser/resource-loader.js\r\n>  @ ./node_modules/jsdom/lib/jsdom/living/nodes/Document-impl.js\r\n>  @ ./node_modules/jsdom/lib/jsdom/living/node-iterator.js\r\n>  @ ./node_modules/jsdom/lib/jsdom/living/index.js\r\n>  @ ./node_modules/jsdom/lib/jsdom.js\r\n>  @ ./node_modules/canvg/canvg.js\r\n>  @ ./src/reports/SummaryWidget.js\r\n>  @ ./src/comp/Summary.js\r\n>  @ ./src/layout/Routes.js\r\n>  @ ./src/Main.js\r\n>  @ ./src/App.js\r\n>  @ multi (webpack)-dev-server/client?http://localhost:8080 webpack/hot/dev-server react-hot-loader/patch webpack/hot/only-dev-server ./src/App.js"},"comment":{"url":"https://api.github.com/repos/canvg/canvg/issues/comments/412212457","html_url":"https://github.com/canvg/canvg/issues/583#issuecomment-412212457","issue_url":"https://api.github.com/repos/canvg/canvg/issues/583","id":412212457,"node_id":"MDEyOklzc3VlQ29tbWVudDQxMjIxMjQ1Nw==","user":{"login":"gabelerner","id":241819,"node_id":"MDQ6VXNlcjI0MTgxOQ==","avatar_url":"https://avatars3.githubusercontent.com/u/241819?v=4","gravatar_id":"","url":"https://api.github.com/users/gabelerner","html_url":"https://github.com/gabelerner","followers_url":"https://api.github.com/users/gabelerner/followers","following_url":"https://api.github.com/users/gabelerner/following{/other_user}","gists_url":"https://api.github.com/users/gabelerner/gists{/gist_id}","starred_url":"https://api.github.com/users/gabelerner/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/gabelerner/subscriptions","organizations_url":"https://api.github.com/users/gabelerner/orgs","repos_url":"https://api.github.com/users/gabelerner/repos","events_url":"https://api.github.com/users/gabelerner/events{/privacy}","received_events_url":"https://api.github.com/users/gabelerner/received_events","type":"User","site_admin":false},"created_at":"2018-08-10T21:33:17Z","updated_at":"2018-08-10T21:33:17Z","author_association":"MEMBER","body":"yup, it should be, please reopen if not"}}
{"actor":{"display_login":"gabelerner"}}