gatsbyjs / gatsby

The best React-based framework with performance, scalability and security built in.

Home Page:https://www.gatsbyjs.com

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Null-Byte (\0) in HTML output files

CodeAndWeb opened this issue · comments

Preliminary Checks

Description

I realized that some of my generated .html files contain \0 bytes.
This is both, in JSX and MDX files.
This only affects 2 output files of 20699 files in my project.

public/texturepacker3d/documentation/index.html, pos: 188642
public/store/texturepacker-single/index.html, pos: 184679

The bytes always appear at the same position. Removing the public folder and re-building leads to the same output.

The source files both do not contain any \0 bytes.

Slight changes to the file - e.g. inserting a blank line somewhere before that line where the \0 appears seems to resolve the issue. Duplicating the source line with the \0 does not make it appear twice.

For me, this sounds somehow as if somebody is reading past the end of some buffer, receiving the terminating 0 byte.

I currently have no idea how to isolate this issue. As
texturepacker-single--index.html.txt
texturepacker3d--documentation--index.html.txt

explained - slightest changes make it disappear.

Reproduction Link

https://githubbox.com/gatsbyjs/gatsby-starter-minimal

Steps to Reproduce

No idea.
Maybe somebody else could check if this also happens in bigger projects?

Expected Result

No \0 byte in html output files.

Actual Result

Some files contain \0 bytes

Environment

System:
    OS: macOS 14.1.1
    CPU: (16) x64 Intel(R) Core(TM) i9-9900K CPU @ 3.60GHz
    Shell: 5.9 - /bin/zsh
  Binaries:
    Node: 18.18.2 - /private/var/folders/bp/g33kcntj17585nbsffq_dq8w0000gn/T/xfs-6406f08f/node
    Yarn: 3.2.2 - /private/var/folders/bp/g33kcntj17585nbsffq_dq8w0000gn/T/xfs-6406f08f/yarn
    npm: 9.8.1 - ~/.nvm/versions/node/v18.18.2/bin/npm
  Languages:
    Python: 2.7.18 - /Library/Frameworks/Python.framework/Versions/2.7/bin/python
  Browsers:
    Chrome: 120.0.6099.71
    Safari: 17.1
  npmPackages:
    gatsby: ^5.12.11 => 5.12.11
    gatsby-cli: ^5.12.4 => 5.12.4
    gatsby-link: ^5.12.1 => 5.12.1
    gatsby-plugin-build-date: ^1.0.0 => 1.0.0
    gatsby-plugin-image: ^3.12.3 => 3.12.3
    gatsby-plugin-manifest: ^5.12.3 => 5.12.3
    gatsby-plugin-matomo: ^0.16.2 => 0.16.2
    gatsby-plugin-mdx: ^5.12.3 => 5.12.3
    gatsby-plugin-nprogress: ^5.12.0 => 5.12.0
    gatsby-plugin-offline: ^6.12.3 => 6.12.3
    gatsby-plugin-postcss: ^6.12.0 => 6.12.0
    gatsby-plugin-robots-txt: ^1.8.0 => 1.8.0
    gatsby-plugin-sharp: ^5.12.3 => 5.12.3
    gatsby-plugin-sitemap: ^6.12.3 => 6.12.3
    gatsby-plugin-typescript: ^5.12.1 => 5.12.1
    gatsby-plugin-webpack-bundle-analyser-v2: ^1.1.32 => 1.1.32
    gatsby-plugin-zopfli: ^2.0.0 => 2.0.0
    gatsby-react-router-scroll: ^6.12.0 => 6.12.0
    gatsby-remark-autolink-headers: ^6.12.3 => 6.12.3
    gatsby-remark-check-links: ^2.1.0 => 2.1.0
    gatsby-remark-copy-linked-files: ^6.12.0 => 6.12.0
    gatsby-remark-images: ^7.12.3 => 7.12.3
    gatsby-remark-rewrite-relative-links: ^1.0.8 => 1.0.8
    gatsby-remark-smartypants: ^6.12.0 => 6.12.0
    gatsby-remark-static-images: ^1.2.1 => 1.2.1
    gatsby-source-filesystem: ^5.12.1 => 5.12.1
    gatsby-transformer-javascript-frontmatter: ^5.12.0 => 5.12.0
    gatsby-transformer-sharp: ^5.12.3 => 5.12.3
    gatsby-transformer-yaml: ^5.12.0 => 5.12.0

Config Flags

No response