Skip to content

Conversation

@kennknowles
Copy link
Contributor

$ 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
[email protected] 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 kennknowles reopened this Aug 13, 2013
@kennknowles
Copy link
Contributor Author

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

@rodneyrehm
Copy link
Member

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

@rodneyrehm rodneyrehm merged commit 57cd8ba into medialize:master Aug 14, 2013
@rodneyrehm
Copy link
Member

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 kennknowles deleted the survive-undefined-root branch August 14, 2013 16:00
@kennknowles
Copy link
Contributor Author

Great! Thanks for the quick response.

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

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants