{"action":"created","issue":{"url":"https://api.github.com/repos/Flyer53/jsPanel4/issues/60","repository_url":"https://api.github.com/repos/Flyer53/jsPanel4","labels_url":"https://api.github.com/repos/Flyer53/jsPanel4/issues/60/labels{/name}","comments_url":"https://api.github.com/repos/Flyer53/jsPanel4/issues/60/comments","events_url":"https://api.github.com/repos/Flyer53/jsPanel4/issues/60/events","html_url":"https://github.com/Flyer53/jsPanel4/issues/60","id":378694727,"node_id":"MDU6SXNzdWUzNzg2OTQ3Mjc=","number":60,"title":"Error using extension with es6module and webpack","user":{"login":"Lock-up","id":12248371,"node_id":"MDQ6VXNlcjEyMjQ4Mzcx","avatar_url":"https://avatars3.githubusercontent.com/u/12248371?v=4","gravatar_id":"","url":"https://api.github.com/users/Lock-up","html_url":"https://github.com/Lock-up","followers_url":"https://api.github.com/users/Lock-up/followers","following_url":"https://api.github.com/users/Lock-up/following{/other_user}","gists_url":"https://api.github.com/users/Lock-up/gists{/gist_id}","starred_url":"https://api.github.com/users/Lock-up/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Lock-up/subscriptions","organizations_url":"https://api.github.com/users/Lock-up/orgs","repos_url":"https://api.github.com/users/Lock-up/repos","events_url":"https://api.github.com/users/Lock-up/events{/privacy}","received_events_url":"https://api.github.com/users/Lock-up/received_events","type":"User","site_admin":false},"labels":[{"id":773925363,"node_id":"MDU6TGFiZWw3NzM5MjUzNjM=","url":"https://api.github.com/repos/Flyer53/jsPanel4/labels/info","name":"info","color":"11a5b2","default":false}],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":7,"created_at":"2018-11-08T11:41:45Z","updated_at":"2018-11-09T17:49:22Z","closed_at":null,"author_association":"NONE","body":"Hi,\r\nI use the es6module version of jspanel4 when I try to add the modal extension I get following error:\r\n\r\n>Uncaught ReferenceError: **_jsPanel_** is not defined \r\n\r\nthe error occurs in jspanel.modal.js\r\n>96: jsPanel.modal.ziModal = (function(startValue = **_jsPanel_**.modal.ziModalBase) {\r\n\r\nThe problem is how webpack packs the file.\r\n\r\nInput:\r\n```\r\n jsPanel.modal.ziModal = (function(startValue = jsPanel.modal.ziModalBase) {\r\n    let val = startValue;  \r\n    return {\r\n        next: function() {\r\n            return val++;\r\n        }\r\n    };\r\n})();\r\n```\r\n\r\nOutput:\r\n```\r\n_jspanel_js__WEBPACK_IMPORTED_MODULE_0__[\"jsPanel\"].modal.ziModal = (function(startValue = jsPanel.modal.ziModalBase) {\r\n    let val = startValue;\r\n    return {\r\n        next: function() {\r\n            return val++;\r\n        }\r\n    };\r\n})();\r\n```\r\n\r\nThe problem is webpack doesn't resolve the **_jsPanel_** variable in the function paramter correctly.\r\nIf I change the input to:\r\n```\r\njsPanel.modal.ziModal = (function() {\r\n    let val = jsPanel.modal.ziModalBase;\r\n    return {\r\n        next: function() {\r\n            return val++;\r\n        }\r\n    };\r\n})();\r\n```\r\n\r\nThen it works fine, output:\r\n```\r\n_jspanel_js__WEBPACK_IMPORTED_MODULE_0__[\"jsPanel\"].modal.ziModal = (function() {\r\n    let val = _jspanel_js__WEBPACK_IMPORTED_MODULE_0__[\"jsPanel\"].modal.ziModalBase;\r\n    return {\r\n        next: function() {\r\n            return val++;\r\n        }\r\n    };\r\n})();\r\n```\r\n\r\nI'm not sure if it is a issue in webpack or something else.\r\nDo you have any idea?"},"comment":{"url":"https://api.github.com/repos/Flyer53/jsPanel4/issues/comments/437439747","html_url":"https://github.com/Flyer53/jsPanel4/issues/60#issuecomment-437439747","issue_url":"https://api.github.com/repos/Flyer53/jsPanel4/issues/60","id":437439747,"node_id":"MDEyOklzc3VlQ29tbWVudDQzNzQzOTc0Nw==","user":{"login":"Flyer53","id":6769021,"node_id":"MDQ6VXNlcjY3NjkwMjE=","avatar_url":"https://avatars3.githubusercontent.com/u/6769021?v=4","gravatar_id":"","url":"https://api.github.com/users/Flyer53","html_url":"https://github.com/Flyer53","followers_url":"https://api.github.com/users/Flyer53/followers","following_url":"https://api.github.com/users/Flyer53/following{/other_user}","gists_url":"https://api.github.com/users/Flyer53/gists{/gist_id}","starred_url":"https://api.github.com/users/Flyer53/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Flyer53/subscriptions","organizations_url":"https://api.github.com/users/Flyer53/orgs","repos_url":"https://api.github.com/users/Flyer53/repos","events_url":"https://api.github.com/users/Flyer53/events{/privacy}","received_events_url":"https://api.github.com/users/Flyer53/received_events","type":"User","site_admin":false},"created_at":"2018-11-09T17:49:22Z","updated_at":"2018-11-09T17:49:22Z","author_association":"OWNER","body":"@Lock-up \r\nThanks for the hint ... I'll check that out."}}
{"actor":{"display_login":"Flyer53"}}