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

Error importing the app-indexeddb-mirror.html #43

Closed
abdonrd opened this issue May 30, 2016 · 11 comments
Closed

Error importing the app-indexeddb-mirror.html #43

abdonrd opened this issue May 30, 2016 · 11 comments
Labels

Comments

@abdonrd
Copy link
Member

abdonrd commented May 30, 2016

Error when I import the app-storage/app-indexeddb-mirror/app-indexeddb-mirror.html.
Only import, even without instantiating the element.

screen shot 2016-05-30 at 13 25 28

All my code is here.

@abdonrd
Copy link
Member Author

abdonrd commented May 30, 2016

The common-worker.html error is because the document._currentScript is undefined:

var BASE_URI = document._currentScript.ownerDocument.baseURI;
var WORKER_SCOPE_URL = Polymer.ResolveUrl.resolveUrl('common-worker-scope.js', BASE_URI);

( I has tried to hardcoded the WORKER_SCOPE_URL variable, and it works. )

@skeemer
Copy link

skeemer commented May 30, 2016

I've been running into this and wondered why something that seems better was removed. cd26416#commitcomment-17661405

@abdonrd
Copy link
Member Author

abdonrd commented May 30, 2016

Thanks for the reference, @skeemer!

@abdonrd
Copy link
Member Author

abdonrd commented May 30, 2016

I think we need to remove the underscore. From:

var BASE_URI = document._currentScript.ownerDocument.baseURI;

To:

var BASE_URI = document.currentScript.ownerDocument.baseURI;

And the webcomponents.js make the polyfill.

(I has tried, and it seems to be working)

@neckaros
Copy link

I had the same issue. polyfill use document._currentScript but for navigator that don't need polyfill var document._currentScript does not exist.

Using var BASE_URI = document.currentScript.ownerDocument.baseURI;
works like a charm on chrome :)

@Borjagodoy
Copy link

@cdata any news about this?

abdonrd referenced this issue Jun 19, 2016
 - Implemented test helpers for mocking online / offline state.
 - Implemented test helpers for reading / writing to IndexedDB.
 - Implemented test helper for deleting an IndexedDB database.
 - Added some basic tests for app-indexeddb-mirror.
 - Gracefully degrade in Safari and other stunted browsers.
eduardosada pushed a commit to eduardosada/app-storage that referenced this issue Jul 8, 2016
eduardosada added a commit to eduardosada/app-storage that referenced this issue Jul 8, 2016
@abdonrd
Copy link
Member Author

abdonrd commented Jul 15, 2016

Any news @cdata? Right now we can't use the component without the polyfill :(

@jesusprubio
Copy link

Any news @cdata? :(

@dtruffaut
Copy link

dtruffaut commented Aug 27, 2016

Same problem here... How can we solve this ?

I changed :

var BASE_URI = document._currentScript.ownerDocument.baseURI;

by:

var BASE_URI = document.currentScript.ownerDocument.baseURI;

It worked.

but now I have another error that remains:

app-indexeddb-mirror.html:249 Uncaught TypeError: Cannot read property 'validateSession' of undefined

          __updatePersistedData: function() {
            this._log('Updating persisted data..');
            this._enqueueTransaction(function() {
            return this.client.validateSession(this.session);    <==== Problem here
          });

UPDATE : I just unlogged from other apps that I was working on (Google Auth) and did a force refresh on my browser and it solved this last error.

christianjoun pushed a commit to christianjoun/app-storage that referenced this issue Sep 6, 2016
See PolymerElements#43
app-indexeddb-mirror.html:249 Uncaught TypeError: Cannot read property 'validateSession' of undefined
@cdata cdata closed this as completed in #66 Sep 21, 2016
@abdonrd
Copy link
Member Author

abdonrd commented Sep 21, 2016

Yay! 😀

@TomK
Copy link

TomK commented Feb 10, 2017

@cdata within the last few days this seems to have reappeared on 2.0-preview. Should #66 also be applied to that branch?
image

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

8 participants