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

[ BUG ] Static rendering when exporting results in empty html files (Bad for SEO) #286

Open
qhoarau opened this issue Dec 2, 2024 · 2 comments
Labels
bug Something isn't working

Comments

@qhoarau
Copy link

qhoarau commented Dec 2, 2024

Describe the bug
When exporting app with static rendering, html files have an empty body content in dist folder

To Reproduce
Steps to reproduce the behavior:

  1. Clone the base project according to documentation
  2. git clone https://github.com/mrzachnugent/react-native-reusables.git
  3. cp -R react-native-reusables/packages/templates/starter-base/ ./my-project
  4. cd my-project && npm install && npx expo install --fix
  5. npx expo export --platform web
  6. go to dist folder
  7. see that index.html body is empty (it shouldn't)

Expected behavior
generated html files should have a body content like expo base template

Screenshots
If applicable, add screenshots to help explain your problem.

Platform (please complete the following information):

  • Type: Build
  • OS: Windows 11
@qhoarau qhoarau added the bug Something isn't working label Dec 2, 2024
@mrzachnugent
Copy link
Owner

Hey @qhoarau , unless something has changed recently that I’m unaware of, this seems to be the expected behavior.

"a single index.html in the output folder and has no statically indexable HTML." - https://docs.expo.dev/distribution/publishing-websites/

When you create a new expo project, and run the same command, do you get the same results?

@qhoarau
Copy link
Author

qhoarau commented Dec 3, 2024

It is the expected behavior if the key inside app.json web.output = single.

But in the default project when we clone the starter-base https://github.com/mrzachnugent/react-native-reusables.git, web.output is set to "static" which should generate an html files for each page and it does BUT the body inside those html files is empty and need rehydration (not good for SEO).

When I build with a brand new expo project with web.output = static, I do get all the html files and the body inside those html files are not empty and filled with the expected content.

I can't really tell why, i'm not experienced enough.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants