Skip to content
This repository has been archived by the owner on Aug 22, 2023. It is now read-only.

obj.hasOwnProperty is not a function #149

Open
shgysk8zer0 opened this issue Dec 16, 2016 · 7 comments
Open

obj.hasOwnProperty is not a function #149

shgysk8zer0 opened this issue Dec 16, 2016 · 7 comments

Comments

@shgysk8zer0
Copy link

  • node --version: v6.9.1
  • npm --version: 3.10.8
  • myth --version: 1.5.0

Full error:

error · TypeError: obj.hasOwnProperty is not a function
             ·   at clone (/usr/lib/node_modules/myth/node_modules/clone-component/index.js:30:17)
             ·   at clone (/usr/lib/node_modules/myth/node_modules/clone-component/index.js:31:23)
             ·   at clone (/usr/lib/node_modules/myth/node_modules/clone-component/index.js:31:23)
             ·   at Object.exports.prefixes (/usr/lib/node_modules/myth/lib/features.js:124:14)
             ·   at /usr/lib/node_modules/myth/lib/index.js:52:33
             ·   at Array.forEach (native)
             ·   at /usr/lib/node_modules/myth/lib/index.js:50:22
             ·   at Rework.use (/usr/lib/node_modules/myth/node_modules/rework/index.js:50:3)
             ·   at myth (/usr/lib/node_modules/myth/lib/index.js:36:6)
             ·   at /usr/lib/node_modules/myth/bin/myth:101:13

I have found that updating /usr/lib/node_modules/myth/node_modules/clone-component/index.js:30:17 to use Object.prototype.hasOwnProperty.call(obj, key) fixes the issue.

@shgysk8zer0
Copy link
Author

shgysk8zer0 commented Dec 17, 2016

component/clone has an update to 0.2.3 which seems to address this issue.

@ianosullivan
Copy link

Hi guys,
I'm also experiencing this issue - 'obj.hasOwnProperty is not a function' - because of my node version I believe. But I can't resolve it.

I love myth but I'm having an issue after changing my dev setup. I've moved from working directly on a dev server to local machine so I've different node setups. Myth is working fine on the dev server.

Local - http://take.ms/fbyqm - has node 6
Dev Server - http://take.ms/6PO2T - has node 0.10

I've found there is a pull request on Github - #143 - but I'm unable to resolve the local issue even after updating the .travis.yml with the node version.

I appreciate that Myth is not fully supported but it'd be a shame to not resolve it. I prefer it to the preprocessors.

Thanks,

Ian.

@shgysk8zer0
Copy link
Author

I've done a bit of research into this, and component/clone on Github is @ 0.2.3 (which fixes the issue), while clone-component on npmjs.com is still only @ 0.2.2.

I have emailed the developer asking to update, but have gotten no reply.

@ianosullivan
Copy link

ianosullivan commented Jan 6, 2017 via email

@pin3da
Copy link

pin3da commented Jan 29, 2017

Hello,

I just published my fork on npm to have a myth version working with node 6

https://www.npmjs.com/package/myth6

@ianosullivan
Copy link

ianosullivan commented Feb 2, 2017 via email

@drnkwati
Copy link

drnkwati commented Oct 2, 2018

Hi guys
Am having this same error
Has anyone found a workaround
Am using npm 6.2.0

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants