{"action":"closed","issue":{"url":"https://api.github.com/repos/medialize/URI.js/issues/310","repository_url":"https://api.github.com/repos/medialize/URI.js","labels_url":"https://api.github.com/repos/medialize/URI.js/issues/310/labels{/name}","comments_url":"https://api.github.com/repos/medialize/URI.js/issues/310/comments","events_url":"https://api.github.com/repos/medialize/URI.js/issues/310/events","html_url":"https://github.com/medialize/URI.js/issues/310","id":173036613,"number":310,"title":"Downloaded build (made with closure compiler) incompatible with RequireJS","user":{"login":"pmorch","id":159292,"avatar_url":"https://avatars.githubusercontent.com/u/159292?v=3","gravatar_id":"","url":"https://api.github.com/users/pmorch","html_url":"https://github.com/pmorch","followers_url":"https://api.github.com/users/pmorch/followers","following_url":"https://api.github.com/users/pmorch/following{/other_user}","gists_url":"https://api.github.com/users/pmorch/gists{/gist_id}","starred_url":"https://api.github.com/users/pmorch/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/pmorch/subscriptions","organizations_url":"https://api.github.com/users/pmorch/orgs","repos_url":"https://api.github.com/users/pmorch/repos","events_url":"https://api.github.com/users/pmorch/events{/privacy}","received_events_url":"https://api.github.com/users/pmorch/received_events","type":"User","site_admin":false},"labels":[],"state":"closed","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":1,"created_at":"2016-08-24T19:24:24Z","updated_at":"2016-08-25T09:02:01Z","closed_at":"2016-08-25T09:02:01Z","body":"I went to [URI.js - Custom Build](https://medialize.github.io/URI.js/build.html) and built some text that I saved to a `URI.js` file. It doesn't work with RequireJS with\r\n\r\n```javascript\r\nvar config = {\r\n   \"paths\" : {\r\n      \"URI\" : \"/path/to/URI\",\r\n    }\r\n};\r\nrequire.config( config );\r\nrequire(['/path/to/URI'], function(URI) { new URI(\"http://www.morch.com\") })\r\n```\r\n\r\nThe first time I get a `TypeError: URI is not a constructor` error and the next time I get a `Error: Mismatched anonymous define() module` error.\r\n\r\nIf I use the `git clone` source or use RequireJS's `r.js` to minify said source it works fine, so it seems there isn't anything wrong with neither URI.js or my use of RequireJS, only that the build process does not yield a result that is compatible with RequireJS.\r\n\r\nFixing the build to be RequireJS compatible and/or a note on the build page would've been nice. \r\n\r\nI'm not sure if this is related to #118  or #147 but this sounds like a different issue - about the closure-compiler-based build.\r\n\r\nAnd to build a RequireJS compatible `URI.min.js`  is really easy:\r\n```\r\nlondo@peter:~/build> git clone git@github.com:medialize/URI.js.git \r\nCloning into 'URI.js'...\r\nremote: Counting objects: 4772, done.\r\nremote: Total 4772 (delta 0), reused 0 (delta 0), pack-reused 4772\r\nReceiving objects: 100% (4772/4772), 2.21 MiB | 2.67 MiB/s, done.\r\nResolving deltas: 100% (2945/2945), done.\r\nChecking connectivity... done.\r\n\r\nlondo@peter:~/build> cd URI.js/\r\n\r\nlondo@peter:~/build/URI.js> npm install requirejs\r\nrequirejs@2.2.0 node_modules/requirejs\r\n\r\nlondo@peter:~/build/URI.js> ./node_modules/.bin/r.js -o baseUrl=./src  name=URI out=URI.min.js\r\n\r\nTracing dependencies for: URI\r\nUglify file: /home/peter/build/URI.js/URI.min.js\r\n\r\n/home/peter/build/URI.js/URI.min.js\r\n----------------\r\n/home/peter/build/URI.js/src/punycode.js\r\n/home/peter/build/URI.js/src/IPv6.js\r\n/home/peter/build/URI.js/src/SecondLevelDomains.js\r\n/home/peter/build/URI.js/src/URI.js\r\n\r\nlondo@peter:~/build/URI.js> ls -l URI.min.js \r\n-rw-r--r-- 1 peter peter 41399 Aug 24 20:54 URI.min.js\r\n```\r\n\r\nThis one works"}}
{"actor":{"display_login":"rodneyrehm"}}