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

Uncaught Error: History.js Adapter has already been loaded... #189

Closed
mandrasch opened this issue Jun 20, 2012 · 32 comments
Closed

Uncaught Error: History.js Adapter has already been loaded... #189

mandrasch opened this issue Jun 20, 2012 · 32 comments
Labels

Comments

@mandrasch
Copy link

Hey Devs!

Very nice plugin/library! Is there a way to get rid of the "Uncaught Error: History.js Adapter has already been loaded... ". I tried with try/catch, but that doesn't work.

I'm using http://labjs.com/ and unfortunately I can't control/check right now if a script was loaded before, so double loading can happen and then historyjs breaks the application with this uncaught error.

Thanks in advance,
Matthias

@fahdoo
Copy link

fahdoo commented Jul 20, 2012

+1

@mariiine
Copy link

mariiine commented Aug 1, 2012

+1!

@kendagriff
Copy link

+1

@catherinek
Copy link

+1

Anyone got a solution to this?

@netandreus
Copy link

+1

How can i fix it?

@bahattincinic
Copy link

+1

4 similar comments
@gheiler
Copy link

gheiler commented Nov 9, 2012

+1

@nandotess
Copy link

+1

@ikermart
Copy link

+1

@dougfarre
Copy link

+1

@juji
Copy link

juji commented Jan 4, 2013

well you can do this

// Check Existence
if ( typeof History.Adapter !== 'undefined' ) {
    //throw new Error('History.js Adapter has already been loaded...');
        return;
}

@ghost
Copy link

ghost commented Jan 18, 2013

Fixed in my fork, get it here:
https://github.com/andreasbernhard/history.js

@ghost
Copy link

ghost commented Mar 8, 2013

Fixed in unstable DEV branch now!

@ghost ghost closed this as completed Mar 8, 2013
@howareyouo
Copy link

+100

@himdel
Copy link

himdel commented Jan 14, 2014

Still doesn't work in master, makes Router.js unuseable.

@misawsneto
Copy link

+100

@pcompassion
Copy link

+1

@PikachuEXE
Copy link

Also causes igor-alexandrov/wiselinks#59

@erikmellum
Copy link

+1 causing me a big headache - can't find a solution for this on google.

@saiponduru
Copy link

+1

4 similar comments
@baptistebriel
Copy link

+1

@aelvan
Copy link

aelvan commented Aug 28, 2014

+1

@jasonzhao3
Copy link

+1

@WiechersV
Copy link

+1

@incorvia
Copy link

seems to happen to me too

@hatemalimam
Copy link

I can't see why this issue is closed !

@amandakievet
Copy link

+1

2 similar comments
@designjockey
Copy link

+1

@shiham55
Copy link

+1

@jclay
Copy link

jclay commented Aug 28, 2015

Unfortunately you're not able to catch this error since it's being thrown within the anonymous function that it's defined within.

Here's a workaround - simply unload History.js prior to loading it to ensure that it is able to setup. This has some side effects if you're planning on storing History between page reloads.

<script type="text/javascript">
    delete History
</script>

<script src="http://www.yourwebsite.com/history.js/scripts/bundled/html4+html5/jquery.history.js"></script>

@itbra
Copy link

itbra commented Jul 1, 2016

+1

Wonder why there is yet no fix by the dev(s). Why not simply substituting the anon function by ref to a regular function? It's that easy!

@O-Zone
Copy link

O-Zone commented Aug 19, 2016

+1

I'm gonna go with jclays proposed unload workaround, but it feels a bit stupid to unload everything when it obviously is a bug that should be fixed in this package instead. It is a 4 years old bug now? :-O

This issue was closed.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests