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

Gatsby static site generation not fully prerendering HTML with loadable imports #38866

Open
2 tasks done
SivaGanesh56 opened this issue Feb 23, 2024 · 0 comments
Open
2 tasks done
Labels
status: triage needed Issue or pull request that need to be triaged and assigned to a reviewer type: bug An issue or pull request relating to a bug in Gatsby

Comments

@SivaGanesh56
Copy link

SivaGanesh56 commented Feb 23, 2024

Preliminary Checks

Description

Gatsby static site generation not fully prerendering static HTML with loadable imports

if i use loadable import, gastby SSG build is not generating static HTML.

sandbox repo: https://github.com/SivaGanesh56/gatsby-loadable-issue

e.g:

import loadable from '@loadable/component';

const AnnouncementBanner = loadable(
  () => import('../../templates/announcementBanner'),
);
const BenchMarking = loadable(
  () => import('../../templates/benchmarkingTemplate'),
);
const BrandGalleryTemplate = loadable(
  () => import('../../templates/brandGallery'),
);

package.json

{
"gatsby": "^4.19.0",
    "gatsby-plugin-advanced-sitemap": "^2.0.0",
    "gatsby-plugin-force-trailing-slashes": "^1.0.6",
    "gatsby-plugin-image": "^2.9.1",
    "gatsby-plugin-loadable-components-ssr": "3.0.0",
    "gatsby-plugin-manifest": "^4.9.1",
    "gatsby-plugin-nprogress": "^4.9.0",
    "gatsby-plugin-postcss": "^6.12.0",
    "gatsby-plugin-preload-fonts": "^3.9.1",
    "gatsby-plugin-react-helmet": "^5.9.0",
    "gatsby-plugin-react-i18next": "^1.2.2",
    "gatsby-plugin-react-svg": "^3.1.0",
    "gatsby-plugin-robots-txt": "^1.7.0",
    "gatsby-plugin-s3": "^0.3.8",
    "gatsby-plugin-sass": "5.24.0",
    "gatsby-plugin-sharp": "^4.9.1",
    "gatsby-plugin-theme-ui": "^0.13.1",
    "gatsby-source-contentful": "^7.11.0-next.0",
    "gatsby-transformer-sharp": "^4.9.0",
     "@loadable/component": "^5.15.2",
}

If I remove imports from loadable, it is working fine. but the only worry is the bloating of bundle size.

Thank you!

Reproduction Link

https://github.com/SivaGanesh56/gatsby-loadable-issue

Steps to Reproduce

Expected Result

Actual Result

Environment

https://github.com/SivaGanesh56/gatsby-loadable-issue

Config Flags

@SivaGanesh56 SivaGanesh56 added the type: bug An issue or pull request relating to a bug in Gatsby label Feb 23, 2024
@gatsbot gatsbot bot added the status: triage needed Issue or pull request that need to be triaged and assigned to a reviewer label Feb 23, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
status: triage needed Issue or pull request that need to be triaged and assigned to a reviewer type: bug An issue or pull request relating to a bug in Gatsby
Projects
None yet
Development

No branches or pull requests

1 participant