#Why does `next build` create .txt files?

23 messages · Page 1 of 1 (latest)

chilly cape
#

I am running 13.5.4, my config file has output: export, the site itself is all static rendered, all pages use app router.

I run next build and alongside every html file, there is a text file with the same path. I have deleted those .txt files and nothing seems to break.

The problem this causes is that the site is running on Cloudflare pages which has 20k page limit, and the .txt files obviously half that limit because every route has two files. Obviously, I can just delete the .txt files every time but I would like to know if the site is breaking in some way I haven't been able to find (and the reason why this happens because I am curious and couldn't find any info in the docs).

naive owlBOT
#

🔎 This post has been indexed in our web forum and will be seen by search engines so other users can find it outside Discord

🕵️ Your user profile is private by default and won't be visible to users outside Discord, if you want to be visible in the web forum you can add the "Public Profile" role in id:customize

✅ You can mark a message as the answer for your post with Right click -> Apps -> Mark Solution
(if you don't see the option, try refreshing Discord with Ctrl + R)

simple flint
#

the txt is for rsc payloads (so that it can get the page data but not need to actually get the html document)

chilly cape
#

So it is only used for hydration? And removing the .txt files would only break the site if you had Client Components?

simple flint
#

next/link does page render without using the next html file, but then to get the new page's data, it needs to use txt

chilly cape
#

So links should be broken?

simple flint
#

if you remove the txt's, yes

#

if you keep, it should work

chilly cape
#

Ah, I see now...

#

I checked the console and it is throwing 404 when I follow links for the missing .txt

#

The pages look fine but it is looking for .txt

simple flint
#

sounds about right

#

also, why do you have 10k pages anyway? dynamic routes (and lots of options)

chilly cape
#

Because the pages don't change often and I don't want to run server

#

I also prefer the web pages to be split away from db, I need db running on my own network but this is a problem if you want to build on cloud provider

chilly cape
simple flint
#

yeah, it downloads those files, and then when you click the link, instant page change

chilly cape
#

👍 Got it now

#

Will need to do some more reading but I appreciate your time and experience.

simple flint
#

yeah, this is kinda hard to explain...

chilly cape
#

It is clear. I was aware of some of this but there is no explanation of the text files in the docs...I should have just checked the console and then I would have understood.

#

Ty.

simple flint
#

tbf that is only how i understood it