{"action":"opened","issue":{"url":"https://api.github.com/repos/ivogabe/small/issues/9","repository_url":"https://api.github.com/repos/ivogabe/small","labels_url":"https://api.github.com/repos/ivogabe/small/issues/9/labels{/name}","comments_url":"https://api.github.com/repos/ivogabe/small/issues/9/comments","events_url":"https://api.github.com/repos/ivogabe/small/issues/9/events","html_url":"https://github.com/ivogabe/small/issues/9","id":188915156,"number":9,"title":"resolveDirectory fails for packages that specify an object in package.json browser field","user":{"login":"BigDataSamuli","id":7766749,"avatar_url":"https://avatars.githubusercontent.com/u/7766749?v=3","gravatar_id":"","url":"https://api.github.com/users/BigDataSamuli","html_url":"https://github.com/BigDataSamuli","followers_url":"https://api.github.com/users/BigDataSamuli/followers","following_url":"https://api.github.com/users/BigDataSamuli/following{/other_user}","gists_url":"https://api.github.com/users/BigDataSamuli/gists{/gist_id}","starred_url":"https://api.github.com/users/BigDataSamuli/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/BigDataSamuli/subscriptions","organizations_url":"https://api.github.com/users/BigDataSamuli/orgs","repos_url":"https://api.github.com/users/BigDataSamuli/repos","events_url":"https://api.github.com/users/BigDataSamuli/events{/privacy}","received_events_url":"https://api.github.com/users/BigDataSamuli/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":0,"created_at":"2016-11-12T14:45:57Z","updated_at":"2016-11-12T14:45:57Z","closed_at":null,"body":"Hi,\r\n\r\nApparently some npm packages (e.g. [asap](https://www.npmjs.com/package/asap)) specify an object in package.json's browser field (see [https://github.com/defunctzombie/package-browser-field-spec](https://github.com/defunctzombie/package-browser-field-spec)). This causes small to fail in the Resolve.resolveDirectory function as path.join throws\r\n```\r\nTypeError: Path must be a string. Received { './asap': './browser-asap.js',\r\n  './asap.js': './browser-asap.js',\r\n  './raw': './browser-raw.js',\r\n  './raw.js': './browser-raw.js',\r\n  './test/domain.js': './test/browser-domain.js' }\r\n    at assertPath (path.js:7:11)\r\n    at Object.join (path.js:468:7)\r\n    ...\r\n```\r\nMaybe emit a warning and fall back to the main field in these cases, and/or allow selecting the preferred main file (e.g. main or browser)?\r\n"}}
{"actor":{"display_login":"BigDataSamuli"}}