{"action":"created","issue":{"url":"https://api.github.com/repos/jakearchibald/idb-keyval/issues/25","repository_url":"https://api.github.com/repos/jakearchibald/idb-keyval","labels_url":"https://api.github.com/repos/jakearchibald/idb-keyval/issues/25/labels{/name}","comments_url":"https://api.github.com/repos/jakearchibald/idb-keyval/issues/25/comments","events_url":"https://api.github.com/repos/jakearchibald/idb-keyval/issues/25/events","html_url":"https://github.com/jakearchibald/idb-keyval/issues/25","id":307018169,"number":25,"title":"Issue using with webpack via require()","user":{"login":"humphd","id":427398,"avatar_url":"https://avatars2.githubusercontent.com/u/427398?v=4","gravatar_id":"","url":"https://api.github.com/users/humphd","html_url":"https://github.com/humphd","followers_url":"https://api.github.com/users/humphd/followers","following_url":"https://api.github.com/users/humphd/following{/other_user}","gists_url":"https://api.github.com/users/humphd/gists{/gist_id}","starred_url":"https://api.github.com/users/humphd/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/humphd/subscriptions","organizations_url":"https://api.github.com/users/humphd/orgs","repos_url":"https://api.github.com/users/humphd/repos","events_url":"https://api.github.com/users/humphd/events{/privacy}","received_events_url":"https://api.github.com/users/humphd/received_events","type":"User","site_admin":false},"labels":[],"state":"closed","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":5,"created_at":"2018-03-20T20:03:36Z","updated_at":"2018-03-21T14:46:03Z","closed_at":"2018-03-21T08:48:56Z","author_association":"NONE","body":"```js\r\nconst idbKeyval = require('idb-keyval');\r\n...\r\nidbKeyval\r\n      .get(id)\r\n      .then(...)\r\n```\r\n\r\ngives me:\r\n\r\n`Uncaught TypeError: idbKeyval.get is not a function`\r\n\r\nVia the console I can see that the browser sees the `idbKeyval` object like this:\r\n\r\n```\r\nidbKeyval\r\n{default: {...}, __esModule: true}\r\n```\r\n\r\nIt looks like I'm hitting [this webpack issue](https://github.com/webpack/webpack/issues/4742), since I've used `require()` vs. `import`.\r\n\r\nI'm not sure that there's anything for you to do, but FYI [this comment aimed at library authors](https://github.com/webpack/webpack/issues/4742#issuecomment-300041285).  It might be worth a documentation note for webpack users, since this seems like a common way one might end-up using your lib.\r\n\r\nThanks for writing it, it's really a perfect little wrapper."},"comment":{"url":"https://api.github.com/repos/jakearchibald/idb-keyval/issues/comments/374962691","html_url":"https://github.com/jakearchibald/idb-keyval/issues/25#issuecomment-374962691","issue_url":"https://api.github.com/repos/jakearchibald/idb-keyval/issues/25","id":374962691,"user":{"login":"jakearchibald","id":93594,"avatar_url":"https://avatars1.githubusercontent.com/u/93594?v=4","gravatar_id":"","url":"https://api.github.com/users/jakearchibald","html_url":"https://github.com/jakearchibald","followers_url":"https://api.github.com/users/jakearchibald/followers","following_url":"https://api.github.com/users/jakearchibald/following{/other_user}","gists_url":"https://api.github.com/users/jakearchibald/gists{/gist_id}","starred_url":"https://api.github.com/users/jakearchibald/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/jakearchibald/subscriptions","organizations_url":"https://api.github.com/users/jakearchibald/orgs","repos_url":"https://api.github.com/users/jakearchibald/repos","events_url":"https://api.github.com/users/jakearchibald/events{/privacy}","received_events_url":"https://api.github.com/users/jakearchibald/received_events","type":"User","site_admin":false},"created_at":"2018-03-21T14:46:03Z","updated_at":"2018-03-21T14:46:03Z","author_association":"OWNER","body":"The 3.0.0 thing should be fixed now.\r\n\r\nI didn't want to add instance methods to the class since they can't tree-shake. This is why I really want the bind operator to land in JS so you can do things like:\r\n\r\n```js\r\nimport { Store, set } from 'idb-keyval';\r\n\r\nconst customStore = new Store('custom-db-name', 'custom-store-name');\r\ncustomStore::set('foo', 'bar');\r\n```\r\n\r\n…but it looks like the proposal is dead."}}
{"actor":{"display_login":"jakearchibald"}}