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

Remove duplicate modules in JavaScript bundles #36291

Open
raoabdullah07 opened this issue Oct 8, 2021 · 2 comments
Open

Remove duplicate modules in JavaScript bundles #36291

raoabdullah07 opened this issue Oct 8, 2021 · 2 comments
Labels
Stale Inactive for one year or more Type: Bug

Comments

@raoabdullah07
Copy link

raoabdullah07 commented Oct 8, 2021

Description

I've checked the score of my AMP pages with Google PageSpeed Insight, and I've got the following red message "Remove duplicate modules in JavaScript bundles"

PSI results

This is the initial piece of code of my AMP pages. I started with them several years ago. Not sure if I have to remove something now.

<!doctype html>
<html  lang="en">
  <head>
    <meta charset="utf-8">
    <meta name="viewport" content="width=device-width,minimum-scale=1,initial-scale=1">
    <title>Full SEO Guide 2020 - On Site SEO - On Page SEO - Off Page SEO Tips</title>
    <link rel="canonical" href="#">
    <script async src="https://cdn.ampproject.org/v0.js"></script>
    <link rel="canonical" href="#">
    <link rel="shortcut icon" type="image/x-icon" href="images/favicon.png">
    <meta name="forntEnd-Developer" content="Abdullah Yousaf">
    <meta property="og:type" content="website ">
    <!-- Chrome, Firefox OS and Opera -->
    <meta name="theme-color" content="#336699"/>
    <!-- Windows Phone -->
    <meta name="msapplication-navbutton-color" content="#336699">
    <!-- iOS Safari -->
    <meta name="apple-mobile-web-app-status-bar-style" content="#336699">
    <meta name="description" content="SmSEO is specially developed for Social Media &amp; Search Engine Optimization Guide. More than 200 SEO Ranking Factors are explained to guide you about On-Site SEO, On-Page SEO, Off-Page SEO, &amp; how to rank a website in Google Search Engine." />
<!--amp- form-->
    <script async custom-element="amp-form" src="https://cdn.ampproject.org/v0/amp-form-0.1.js"></script>
<!--accordian-->
    <script async custom-element="amp-accordion" src="https://cdn.ampproject.org/v0/amp-accordion-0.1.js"></script>
    <script async custom-element="amp-sidebar" src="https://cdn.ampproject.org/v0/amp-sidebar-0.1.js"></script>
<!--scroll to top-->
    <script async custom-element="amp-position-observer" src="https://cdn.ampproject.org/v0/amp-position-observer-0.1.js"></script>
    <script async custom-element="amp-animation" src="https://cdn.ampproject.org/v0/amp-animation-0.1.js"></script>

Checking the code of my AMP pages, I see that the 'amp-sidebar' is called just in the following pieces of code:

Reproduction Steps

https://stackoverflow.com/questions/69491974/google-amp-duplicate-js-module-in-html-google-amp-html-at-google-pagespeed-i

Relevant Logs

n/a

Browser(s) Affected

Chrome

OS(s) Affected

No response

Device(s) Affected

No response

AMP Version Affected

V0.1

@westonruter
Copy link
Member

Closely related to #28638 where PSI suggests to remove unused JavaScript.

See #28638 (comment) from @kristoferbaxter:

Efforts are ongoing to reduce the size of AMP's JavaScript payloads, including Bento, AMP Compiler, and Module/NoModule mode.

I think the issue of duplicate modules could only be solved by utilizing ES module imports rather than bundling the duplicate modules in each extension binary. With the removal of IE11 support and the implementation of module scripts, I believe this is now a possibility.

@stale
Copy link

stale bot commented Dec 24, 2022

This issue has been automatically marked as stale because it has not had recent activity. It will be closed in 7 days if no further activity occurs. Thank you for your contributions.

@stale stale bot added the Stale Inactive for one year or more label Dec 24, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Stale Inactive for one year or more Type: Bug
Projects
None yet
Development

No branches or pull requests

2 participants