marcuswestin / store.js

Cross-browser storage for all use cases, used across the web.
MIT License
14.01k stars 1.33k forks source link

ReferenceError: store is not defined on a certain url #279

Open chuckplantain opened 6 years ago

chuckplantain commented 6 years ago

I was trying to use this and was successful in all cases (other urls) except one. I paste any of the minified versions of this library on this url:

browser: Firefox dev edition

Note: works on all other urls I have tested.

screen shot 2018-05-03 at 2 41 09 pm

chuckplantain commented 6 years ago

Sorry for the noise, I had a breakpoint on, oops. Thanks for the lib

chuckplantain commented 6 years ago

over reacted, still an issue

ensemblebd commented 6 years ago

Yup the installation guide is trash.

The only thing that worked for me in an actual live website which isn't built for this plugin, was to:

require(['/_assets/vendor/store-js/dist/store.modern.min.js'], function(result) {
     window.storage=result;
     if (typeof(window.storageReadyCallback)==='function') window.storageReadyCallback(window.storage);
});

The script can be changed out with "legacy" or "everything", but demands the min.js files, since this system makes assumptions about the context of your require.js library setup.

I have yet to see if the rest of the plugin functions properly. But I would assume it does. Here's hoping.