{"action":"created","issue":{"url":"https://api.github.com/repos/electron-userland/electron-webpack/issues/99","repository_url":"https://api.github.com/repos/electron-userland/electron-webpack","labels_url":"https://api.github.com/repos/electron-userland/electron-webpack/issues/99/labels{/name}","comments_url":"https://api.github.com/repos/electron-userland/electron-webpack/issues/99/comments","events_url":"https://api.github.com/repos/electron-userland/electron-webpack/issues/99/events","html_url":"https://github.com/electron-userland/electron-webpack/issues/99","id":298023195,"number":99,"title":"Opening images in development errors","user":{"login":"holywyvern","id":8978215,"avatar_url":"https://avatars0.githubusercontent.com/u/8978215?v=4","gravatar_id":"","url":"https://api.github.com/users/holywyvern","html_url":"https://github.com/holywyvern","followers_url":"https://api.github.com/users/holywyvern/followers","following_url":"https://api.github.com/users/holywyvern/following{/other_user}","gists_url":"https://api.github.com/users/holywyvern/gists{/gist_id}","starred_url":"https://api.github.com/users/holywyvern/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/holywyvern/subscriptions","organizations_url":"https://api.github.com/users/holywyvern/orgs","repos_url":"https://api.github.com/users/holywyvern/repos","events_url":"https://api.github.com/users/holywyvern/events{/privacy}","received_events_url":"https://api.github.com/users/holywyvern/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":8,"created_at":"2018-02-17T17:55:59Z","updated_at":"2018-02-27T14:31:17Z","closed_at":null,"author_association":"NONE","body":"When I try to read an Image from a file inside my documents folder (e.g. C:/users/me/Documents/test.png) doesn't work, the loader keeps intercepting the file and trying to find it locally on the project directory.\r\n\r\nIt prints this error:\r\n\r\n```\r\nNot allowed to load local resource: file:///users/me/Documents/test.png\r\n```\r\n\r\nThis problem only applies on development, when the app is on production it works as expected and the image is displayed without trouble.\r\n"},"comment":{"url":"https://api.github.com/repos/electron-userland/electron-webpack/issues/comments/368896487","html_url":"https://github.com/electron-userland/electron-webpack/issues/99#issuecomment-368896487","issue_url":"https://api.github.com/repos/electron-userland/electron-webpack/issues/99","id":368896487,"user":{"login":"holywyvern","id":8978215,"avatar_url":"https://avatars0.githubusercontent.com/u/8978215?v=4","gravatar_id":"","url":"https://api.github.com/users/holywyvern","html_url":"https://github.com/holywyvern","followers_url":"https://api.github.com/users/holywyvern/followers","following_url":"https://api.github.com/users/holywyvern/following{/other_user}","gists_url":"https://api.github.com/users/holywyvern/gists{/gist_id}","starred_url":"https://api.github.com/users/holywyvern/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/holywyvern/subscriptions","organizations_url":"https://api.github.com/users/holywyvern/orgs","repos_url":"https://api.github.com/users/holywyvern/repos","events_url":"https://api.github.com/users/holywyvern/events{/privacy}","received_events_url":"https://api.github.com/users/holywyvern/received_events","type":"User","site_admin":false},"created_at":"2018-02-27T14:31:17Z","updated_at":"2018-02-27T14:31:17Z","author_association":"NONE","body":"I tried to put only file:, but the problem is still there...\r\n\r\nHere it's what my code is actually doing:\r\n\r\n## components/ImagePreview.js\r\n```jsx\r\nimport React from \"react\";\r\nimport { format as formatUrl } from \"url\";\r\n\r\nconst ImagePreview = ({ src }) => {\r\n    return (\r\n        <div className=\"img-preview\">\r\n            <div className=\"img-container\"> \r\n                <img src={formatUrl({\r\n                    pathname: src,\r\n                    protocol: 'file',\r\n                    slashes: true\r\n                })} />\r\n            </div>\r\n        </div>\r\n    );\r\n};\r\n\r\nexport default ImagePreview;\r\n```\r\nsrc is the absolute path to file.\r\nThe file in src of course exists and it works fine on production, the problem exists in development.\r\n\r\nI tried changing the formatUrl as:\r\n\r\n```jsx\r\n<img src={`file:${src}`} />\r\n```\r\n\r\nBut it doesn't work on development, yet again, it does on production"}}
{"actor":{"display_login":"holywyvern"}}