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

TypeError: Cannot read property 'origin' of undefined #9871

Closed
zhouyx opened this issue Jun 12, 2017 · 9 comments · Fixed by #26290
Closed

TypeError: Cannot read property 'origin' of undefined #9871

zhouyx opened this issue Jun 12, 2017 · 9 comments · Fixed by #26290

Comments

@zhouyx
Copy link
Contributor

zhouyx commented Jun 12, 2017

@jridgewell
Copy link
Contributor

The cause is because

const url = ampdoc.getUrl();
(the $g.get call in the trace) is somehow returning undefined.

@jridgewell
Copy link
Contributor

This is definitely coming from Shadow Docs by way of

attachShadowDoc_(hostElement, url, initParams, builder) {
. Since this method is exposed externally, it probably mean someone has implemented their PWA badly.

/to @choumx to add assertions.

@ampprojectbot
Copy link
Member

This issue hasn't been updated in awhile. @zhouyx Do you have any updates?

@zhouyx zhouyx removed their assignment Jan 17, 2018
@ampprojectbot
Copy link
Member

This issue hasn't been updated in awhile. @choumx Do you have any updates?

@dreamofabear dreamofabear removed their assignment Jul 9, 2018
@ampprojectbot
Copy link
Member

This issue hasn't been updated in awhile. Do you have any updates?

1 similar comment
@ampprojectbot
Copy link
Member

This issue hasn't been updated in awhile. Do you have any updates?

@kevinkimball
Copy link
Contributor

This happens when you forget to pass the third argument (url) to attachShadowDoc

@kevinkimball
Copy link
Contributor

@choumx did you have something in mind you wanted to do about this, e.g. logging a warning or preventing error reporting? Otherwise I am inclined to close this issue.

@dreamofabear
Copy link

Hm, could we verify the arguments to attachShadowDoc and fire a "user" error (which are heavily throttled in reporting)?

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

Successfully merging a pull request may close this issue.

5 participants