question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Page content loaded inside a 'gatsby-announcer' div

See original GitHub issue

Description

The project works perfectly fine in the development but after building and serving the project, the content of some pages is wrapped by a ‘gatsby-announcer’ div which has a ‘position:absolute;top:0;width:1px;height:1px;padding:0;overflow:hidden;clip:rect(0, 0, 0, 0);white-space:nowrap;border:0’ style and therefore the content basically becomes hidden. The problem is that the page loads, I can see it flicker for a split second but very quickly disappears so I’m guessing it has something to do with some gatsby script.

Steps to reproduce

Unfortunately I’m not sure how to reproduce the problem myself. For some reason, only my old pages are affected. When creating new pages, they seem to work fine.

Expected result

The content to load normally.

Actual result

The content gets wrapped by a ‘small’ div.

Environment

Run gatsby info --clipboard in your project directory and paste the output here.

System: OS: Windows 10 10.0.18363 CPU: (8) x64 Intel® Core™ i7-6700 CPU @ 3.40GHz Binaries: Node: 12.13.0 - C:\Program Files\nodejs\node.EXE Yarn: 1.19.1 - C:\Program Files (x86)\Yarn\bin\yarn.CMD npm: 6.12.0 - C:\Program Files\nodejs\npm.CMD Languages: Python: 2.7.17 Browsers: Edge: 44.18362.449.0 npmPackages: gatsby: ^2.19.28 => 2.20.23 gatsby-image: ^2.2.42 => 2.3.3 gatsby-plugin-facebook-pixel: ^1.0.3 => 1.0.3 gatsby-plugin-firebase: ^0.2.0-beta.4 => 0.2.0-beta.4 gatsby-plugin-manifest: ^2.2.42 => 2.3.4 gatsby-plugin-material-ui: ^2.1.6 => 2.1.6 gatsby-plugin-postcss: ^2.1.20 => 2.2.2 gatsby-plugin-react-svg: ^3.0.0 => 3.0.0 gatsby-plugin-sharp: ^2.4.5 => 2.5.5 gatsby-source-filesystem: ^2.1.48 => 2.2.3 gatsby-transformer-sharp: ^2.3.16 => 2.4.5

Issue Analytics

  • State:closed
  • Created 3 years ago
  • Comments:23 (9 by maintainers)

github_iconTop GitHub Comments

2reactions
lucianokrebsscommented, Jun 22, 2020

Hahahah strange stuff. Seems that the problem was the order of the <ToastComponent />. Move it to outside, after the children coming from the wrapRootElement fixed the issue @Js-Brecht

1reaction
lucianokrebsscommented, Jun 22, 2020

Same issue here, not able to fix. Even changing the wrapRootElement to wrapPageElement, the problem persists.

image

Read more comments on GitHub >

github_iconTop Results From Across the Web

gatsby-plugin-no-javascript-utils
The <div id="gatsby-announcer" ⋯> is announcing route changes in a single-page application where the pages update without a reload.
Read more >
Introduction to Gatsby with TypeScript and GitHub Pages
Gatsby, at its core, is a static site generator. It takes our React code and Markdown files and generates HTML pages during the...
Read more >
Gatsby losing/disappearing CSS on page refresh?
Issue. After looking at your site's html, the issue is the template of your new page, that does not have the style tag....
Read more >
Add a headless CMS to Gatsby.js in 5 minutes - Storyblok
js source plugin is loading content at build time because Gatsby serves pages with SSG by default. So, whenever you change the content...
Read more >
Gatsby React Minimum Viable Markdown Template ...
The BasicDiv React component is never used directly by Gatsby in the building of a “page” from data such as the contents of...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found