simple-lastfm icon indicating copy to clipboard operation
simple-lastfm copied to clipboard

$.extend is not a function

Open Shuunen opened this issue 8 years ago • 4 comments

Hello :)

It seems that the trick : var $ = require('jquery')((require("jsdom").jsdom().defaultView));

also found here : https://github.com/jquery/jquery/issues/2758

does not works anymore, maybe using Underscore or Lodash to have this extend feature would do the job.

I have this with node 6.10 & npm 3.10

Shuunen avatar Jun 06 '17 16:06 Shuunen

You could probably remove the jQuery dependency and just use native JavaScript's Object.assign in it place

try this:

delete Line 5

find & replace: find: $.extend replace: Object.assign

that should work. let me know if that does the trick

FranciscoG avatar Jun 06 '17 20:06 FranciscoG

works great thanks :)

You make a PR or I do ? :p

Shuunen avatar Jun 07 '17 08:06 Shuunen

go for it! I'm not using this library but watching it so that's why I saw this issue. So please feel free to submit the PR.

Object.assign got added to Node back around Node 4.8.3. I believe most people are using a much newer version of node but it might be worth mentioning just in case.

FranciscoG avatar Jun 07 '17 14:06 FranciscoG

Sorry for never taking care of this, I've just pushed an update that duplicates what @Shuunen did on his now closed PR.

atomjack avatar Mar 07 '21 19:03 atomjack