Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

TypeError: uri.path is not a function #225

Closed
mattmcginnis opened this issue Aug 2, 2016 · 11 comments
Closed

TypeError: uri.path is not a function #225

mattmcginnis opened this issue Aug 2, 2016 · 11 comments

Comments

@mattmcginnis
Copy link
Contributor

mattmcginnis commented Aug 2, 2016

I'm getting this error after trying to upgrade to the latest factory guy. It's related to this commit: 182143a

TypeError: uri.path is not a function
    at MockFindRequest.basicRequestMatches (mock-request.js:122)
    at MockFindRequest.<anonymous> (mock-request.js:135)
    at getMockForRequest (jquery.mockjax.js:165)
    at Function.handleAjax [as ajax] (jquery.mockjax.js:643)
    at Class._ajaxRequest (rest.js:948)
    at rest.js:938
    at Object.initializePromise (ember.debug.js:51552)
    at new Promise (ember.debug.js:53147)
    at Class.ajax (rest.js:900)
    at Class.findAll (rest.js:414)

Any ideas? It seems like urijs is not being loaded or not working.

@danielspaniel
Copy link
Collaborator

Mmmmmm .. yes, maybe so. There are occasional screw ups where bower stuff will not install and I have to do manually .. can you try install manually ( urljs ) and see if that fixes it.
And just for fun, make new ember project and then see if that installs ok?
Sometimes upgrades don't work as expected.

@mattmcginnis
Copy link
Contributor Author

The error does go away when I install urijs with bower. I'll try making a new project when I get a chance. I don't have a canned app with FG tests to use for that.

@danielspaniel
Copy link
Collaborator

great .. i am glad that worked or else the world would be upside down.
and for trying it out on new:
you don't even need anything special
just ember new blah
go to blah directory
ember install ember-data-factory-guy
and see it ulrjs is there .. in bower dir

@mattmcginnis
Copy link
Contributor Author

Ok, done. It's not in my bower_components directory, but it is in node_modules/ember-data-factory-guy/node_modules.

@danielspaniel
Copy link
Collaborator

hmm .. so it is not bower component .. ok . oops .. did not realize ..

@danielspaniel
Copy link
Collaborator

that was added to dependencies .. but wonder why it did not install when you updated ... ? puzzler

@mattmcginnis
Copy link
Contributor Author

Maybe urijs should be in bower dependencies instead of package dependencies like jquery-mockjax and then added to the FG index blueprint ala mockjax

  afterInstall: function() {
    return this.addBowerPackageToProject('jquery-mockjax', '2.2.0');
  }

If so, I can submit a PR for this.

@danielspaniel
Copy link
Collaborator

I think it is not a bower install though. It is labeled as package dependency in factory guy package.json
so it should have installed when factory guy installs. That is basic procedure.
Your update might have just messed up? A one off ? Perhaps.
Though maybe I have to update the docs on how to properly update factory guy so it gets new dependencies ?? but npm install should do it .. it's pretty simple. so its a puzzler

@mattmcginnis
Copy link
Contributor Author

Maybe I'm confused. Urijs wasn't installed in the bower_components directory with a fresh ember/FG install. However, it was in node_modules/ember-data-factory-guy/nod_modules. Is that sufficient for it to work? My guess is "No" since it doesn't. Running npm install did not change anything. Sorry for the confusion. The difference between addon dependencies in bower vs package is still a bit of a mystery to me.

I guess my next question would be, why is jquery-mockjax in bower.json instead of package.json?

@danielspaniel
Copy link
Collaborator

right .. yeah ..
urljs is strictly a package ( node_modules ) dependency
mockjax is only bower dependency because it does not have npm package.
some javascript projects do bower and npm, others just bower, or npm, and other none at all ..

@danielspaniel
Copy link
Collaborator

I think you resolved this .. so I am closing it. If anything needs addressing though, let me know.

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

No branches or pull requests

2 participants