Closed FDiskas closed 7 years ago
:inbox_tray: You should probably use this: https://toddmotto.com/what-function-window-document-undefined-iife-really-means/#non-browser-global-environments
@FDiskas This is exactly what I've done: https://github.com/DeuxHuitHuit/quicksearch/blob/f3fdd0d3849110043981c0b7b157da52f1912a60/src/jquery.quicksearch.js#L334 use this
has the global env.
Also, the 'global' keyword is nowhere to be found in 'dist/jquery.quicksearch.min.js', which is the "main" file in package.json... Maybe the code is not es6 ready.... Can you check what the "this" keywords refers to ?
Having the same issue, compiled using webpack.
require('jquery.quicksearch');
jquery.quicksearch.min.js?9531:6 Uncaught TypeError: b.clearTimeout is not a function(…)
@FDiskas were you able to find a solution?
I was able to get a quick fix by editing jquery.quicksearch.min.js
and changing !function(a,b,c){}(jQuery,this);
to !function(a,b,c){}(jQuery,window);
Perhaps I may have some configuration issue with how everything is being compiled? Any advice @nitriques?
Any advice @nitriques?
I clearly do not understand what's going on. window
does not exists in node...
I'll try to check this tonite.
@reganjohnson first i did a fork then for some time i used the fork. Now I just removed this dependency
@FDiskas I am still open to a valid fix.
Working solution for me was this https://github.com/DeuxHuitHuit/quicksearch/pull/33/files
Check the last file changes src/jquery.quicksearch.js
@FDiskas Are you using webpack as well ?
I would really like to fix this and here's what I do not understand.
global == this
is true. It has setTimeout()
and clearTimeout()
.window == undefined
.I am a complete webpack
n00b. I forked the original project because it was and still is not maintained. I would really like to keep the original things working but still be able to make it work under webpack. Any help on that issue would be cool. Would the loader referenced earlier by @FDiskas works usign webpack ?
Yes webpack
On Fri, Nov 18, 2016, 3:40 AM Nicolas Brassard notifications@github.com wrote:
I would really like to fix this and here's what I do not understand.
- In node, global == this is true. It has setTimeout() and clearTimeout().
- In node, window == undefined.
- I do not see how this https://github.com/DeuxHuitHuit/quicksearch/blob/master/src/jquery.quicksearch.js#L330 can works.
I am a complete webpack n00b. I forked the original project because it was and still is not maintained. I would really like to keep the original things working but still be able to make it work under webpack. Any help on that issue would be cool. Would the loader referenced earlier by @FDiskas https://github.com/FDiskas works usign webpack ?
— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub https://github.com/DeuxHuitHuit/quicksearch/issues/36#issuecomment-261425100, or mute the thread https://github.com/notifications/unsubscribe-auth/AAckJlFTS-iJjTm0cAXZcZVq7jtjHR9Xks5q_QIIgaJpZM4KZgOy .
Ok, that may be the root of the problem. I'll test it ASAP.
@FDiskas @patrocle @reganjohnson I've publish version 2.3.2 on npm, would you mind to test it ? It's still in the dev branch. Thanks.
It works ! Thanks !
Thanks @patrocle . It has been on npm for some time now and I've juste merged it into master.
Im using latest
I installed this plugin via NPM and included it using es6