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

invalid byte sequence when deploying to github #485

Closed
cderv opened this issue Mar 29, 2023 · 3 comments
Closed

invalid byte sequence when deploying to github #485

cderv opened this issue Mar 29, 2023 · 3 comments

Comments

@cderv
Copy link
Collaborator

cderv commented Mar 29, 2023

Possibly related to #436

One example is below.
https://github.com/Mihiretukebede/mihiretukebede.gitlub.io/blob/master/_posts/2021-06-07-scraping-individual-participant-data-from-scatter-plots/scraping-individual-participant-data-from-scatter-plots.Rmd

After knitting that rmd file and pushing the changes, the build page fails with the following error (only for this one but I have a hge chunk of such error for other files).

Error: could not read file /github/workspace/_posts/2021-06-07-scraping-individual-participant-data-from-scatter-plots/scraping-individual-participant-data-from-scatter-plots_files/figure-html5/unnamed-chunk-4-1.png: invalid byte sequence in UTF-8
             Error: could not read file /github/workspace/_posts/2021-06-07-scraping-individual-participant-data-from-scatter-plots/df.gif: invalid byte sequence in UTF-8
             Error: could not read file /github/workspace/_posts/2021-06-07-scraping-individual-participant-data-from-scatter-plots/paste-586399E8.png: invalid byte sequence in UTF-8
             Error: could not read file /github/workspace/_posts/2021-06-07-scraping-individual-participant-data-from-scatter-plots/scatterPlotdigitize.JPG: invalid byte sequence in UTF-8
             Error: could not read file /github/workspace/_posts/2021-06-07-scraping-individual-participant-data-from-scatter-plots/digitize.jpg: invalid byte sequence in UTF-8
             Error: could not read file /github/workspace/_posts/2021-06-07-scraping-individual-participant-data-from-scatter-plots/Animationnewlastr.gif: invalid byte sequence in UTF-8
             Error: could not read file /github/workspace/_posts/2021-06-07-scraping-individual-participant-data-from-scatter-plots/lm.png: invalid byte sequence in UTF-8
             Error: could not read file /github/workspace/_posts/2021-06-07-scraping-individual-participant-data-from-scatter-plots/publication.png: invalid byte sequence in UTF-8
             Error: could not read file /github/workspace/_posts/2021-06-07-scraping-individual-participant-data-from-scatter-plots/corr.png: invalid byte sequence in UTF-8
             Error: could not read file /github/workspace/_posts/2021-06-07-scraping-individual-participant-data-from-scatter-plots/points.gif: invalid byte sequence in UTF-8

Originally posted by @Mihiretukebede in #436 (comment)

@cderv cderv changed the title invalid byte sequence when deploying to githu invalid byte sequence when deploying to github Mar 29, 2023
@cderv
Copy link
Collaborator Author

cderv commented Mar 29, 2023

@Mihiretukebede thanks for sharing more on this. I created a new issue to discuss as this is not directly the same as #436

You are seeing the error when deploying to Github. One comment on that (possibly not related but importat):

Your build where you see the error is using Jekyll to render the site. This is the default as explained in https://docs.github.com/en/pages/getting-started-with-github-pages/about-github-pages#static-site-generators

If you publish your site from a source branch, GitHub Pages will use Jekyll to build your site by default. If you want to use a static site generator other than Jekyll, we recommend that you write a GitHub Actions to build and publish your site instead. Otherwise, disable the Jekyll build process by creating an empty file called .nojekyll in the root of your publishing source, then follow your static site generator's instructions to build your site locally.

With a distill rendered website, you don't want Jekyll. Our documentation mentions this .nojekyll file addition

Create a file named .nojekyll in your repository (this is required to disable some processing of HTML files that GitHub does by default).

I don't know if this is related to the problem but it definitely could be. Are you expecting the site to be built with Jekyll ?

Other comment : encoding: utf-8 is unused in distill_article(). you probably don't need it.

Regarding the error, I see

Error: could not read file /github/workspace/_posts/2020-09-30-2020-09-30-plotting-model-coefficients-in-a-forest-plot/2020-09-30-plotting-model-coefficients-in-a-forest-plot_files/figure-html5/unnamed-chunk-9-1.png: invalid byte sequence in UTF-8

This image for example is from 3 years ago https://github.com/Mihiretukebede/mihiretukebede.gitlub.io/blob/master/_posts/2020-09-30-2020-09-30-plotting-model-coefficients-in-a-forest-plot/2020-09-30-plotting-model-coefficients-in-a-forest-plot_files/figure-html5/unnamed-chunk-9-1.png

So I don't think this is a change in distill recently that made Github be unable to read the image.

#436 was about some string we read / write in distill - here is seems like a Github / Jekyll issue somehow.

@Mihiretukebede
Copy link

Thank you very very much @cderv. That was amazing! I first couldn't believe simply adding an empty .nojekyll file would solve everything. It worked automagically!!!

@cderv
Copy link
Collaborator Author

cderv commented Mar 29, 2023

Glad it works. I was afraid we missed something, glad it is just a misunderstanding issue.

I'll close this. Thanks !

@cderv cderv closed this as not planned Won't fix, can't repro, duplicate, stale Mar 29, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants