npm installed URIjs 1.11.1 fails to load with `TypeError: Cannot read property 'IPv6' of undefined` #107

Merged
merged 1 commit into from Aug 14, 2013

Conversation

Projects
None yet
2 participants
Contributor

kennknowles commented Aug 13, 2013

$ npm install URIjs
npm http GET https://registry.npmjs.org/URIjs
npm http 200 https://registry.npmjs.org/URIjs
npm http GET https://registry.npmjs.org/URIjs/-/URIjs-1.11.1.tgz
npm http 200 https://registry.npmjs.org/URIjs/-/URIjs-1.11.1.tgz
URIjs@1.11.1 node_modules/URIjs
$ node
> require('URIjs')
TypeError: Cannot read property 'IPv6' of undefined
    at ./node_modules/URIjs/src/IPv6.js:39:17
    at _IPv6 (./node_modules/URIjs/src/IPv6.js:19:26)
    at Object.<anonymous> (./node_modules/URIjs/src/IPv6.js:27:2)
    at Module._compile (module.js:456:26)
    at Object.Module._extensions..js (module.js:474:10)
    at Module.load (module.js:356:32)
    at Function.Module._load (module.js:312:12)
    at Module.require (module.js:364:17)
    at require (module.js:380:17)
    at _URI (./submodules/solidstate.js/node_modules/URIjs/src/URI.js:18:57)

I haven't totally grokked the packaging of URIjs, or I'd attach some code.

It looks like on https://github.com/medialize/URI.js/blob/gh-pages/src/IPv6.js#L39 that root will always be undefined for node, due to https://github.com/medialize/URI.js/blob/gh-pages/src/IPv6.js#L19 calling factory with no args.

It looks like each file assumes root exists when generally it doesn't. Am I missing something?

kennknowles reopened this Aug 13, 2013

Contributor

kennknowles commented Aug 13, 2013

OK good to go. This does work in node and all the tests that were passing before are still passing.

Owner

rodneyrehm commented Aug 13, 2013

I guess that we should "disable" (not remove) the .noConflict() methods as well?

rodneyrehm merged commit 57cd8ba into medialize:master Aug 14, 2013

Owner

rodneyrehm commented Aug 14, 2013

I've merged your fix into master and added your fix to URITemplate.js as well. I'll throw out another release today.

Thank you for your help!

kennknowles deleted the kennknowles:survive-undefined-root branch Aug 14, 2013

Contributor

kennknowles commented Aug 14, 2013

Great! Thanks for the quick response.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment