"_.pluck is not a function" error
See original GitHub issueGreat JS client, and works really well.
One issue I’ve found is that when using it in the WP Editor area (as part of a JS-fuelled WordPress plugin using React), I get the following console errors:
load-scripts.php?c=0&load[]=hoverIntent,common,admin-bar,heartbeat,autosave,wp-ajax-response,jquery…:380 Uncaught TypeError: _.pluck is not a functiondetach @ load-scripts.php?c=0&load[]=hoverIntent,common,admin-bar,heartbeat,autosave,wp-ajax-response,jquery…:380render @ load-scripts.php?c=0&load[]=hoverIntent,common,admin-bar,heartbeat,autosave,wp-ajax-response,jquery…:380render @ load-scripts.php?c=0&load[]=hoverIntent,common,admin-bar,heartbeat,autosave,wp-ajax-response,jquery…:416init @ load-scripts.php?c=0&load[]=hoverIntent,common,admin-bar,heartbeat,autosave,wp-ajax-response,jquery…:417i @ jquery.js:1fireWith @ jquery.js:1ready @ jquery.js:1K @ jquery.js:1
load-scripts.php?c=0&load[]=hoverIntent,common,admin-bar,heartbeat,autosave,wp-ajax-response,jquery…:419 Uncaught TypeError: _.pluck is not a function
and
load-scripts.php?c=0&load[]=hoverIntent,common,admin-bar,heartbeat,autosave,wp-ajax-response,jquery…:663 Uncaught TypeError: Cannot read property 'hasClass' of undefined
I’ve extensively tested and turned everything else off/on, and only when I remove the node-wpapi library from my webpack file (therefore not including it in my project) do the above errors stop.
Issue Analytics
- State:
- Created 7 years ago
- Comments:8
Top Results From Across the Web
What happened to Lodash _.pluck? - Stack Overflow
My eyes completely skipped over the fat arrow. Ah well, clips.map(function (clip) { return clip.id }) still isn't so bad I guess ;-)....
Read more >Uncaught TypeError: _.pluck is not a function causing issues ...
Opening the inspection console in chrome, I get the following error in the log. Uncaught TypeError: _.pluck is not a function at Object....
Read more >Underscore.js _.pluck Function - GeeksforGeeks
The _. pluck() function is used when we need to extract a list of a given property. Like we have to find out...
Read more >pluck - RxJS
pluck marble diagram. Given a list of strings or numbers describing a path to a property, retrieves the value of a specified nested...
Read more >Developers - "_.pluck is not a function" error - - Bountysource
"_.pluck is not a function" error ... Great JS client, and works really well. One issue I've found is that when using it...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
Thanks for this guys. I ran into the same issue ~2 years later making use of lodash’s pluck method in a React / Redux driven WP plugin. I was importing it -
import __ from "lodash";
I’ve been habitually setting “this” to _ in methods, probably from my Angular days, I thought this was the conflict initially. This fixed it:
import ld from "lodash";
let __ = ld.noConflict();
😁 Glad this issue lives on and helps people!