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 thrown in chrome parsing amp-worker.js #39381

Closed
dickie81 opened this issue Aug 16, 2023 · 2 comments
Closed

Error thrown in chrome parsing amp-worker.js #39381

dickie81 opened this issue Aug 16, 2023 · 2 comments

Comments

@dickie81
Copy link
Contributor

Description

We have just noticed an error while parsing amp-worker.js introduced in this commit 54c0400 specifically around line 101.

    if (self.trustedTypes && self.trustedTypes.createPolicy) {
      const policy = self.trustedTypes.createPolicy(
        'amp-worker#fetchUrl',
        policy
      );
    }

As you can see just reading the code policy will be undefined.

image

Reproduction Steps

I can't list the site where this is occurring on as it is commercially sensitive. But if you paste the following code in the browser console it will demonstrate the general idea.

const x = 0;

if (true) {
  const x = alert(x);
}

Relevant Logs

No response

Browser(s) Affected

Chrome, Safari

OS(s) Affected

No response

Device(s) Affected

No response

AMP Version Affected

2308042153000

@guitavano
Copy link

I have the same issue here, since today's morning.

@dickie81
Copy link
Contributor Author

dupliclate of #39380

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

No branches or pull requests

2 participants