stereobooster / react-snap

👻 Zero-configuration framework-agnostic static prerendering for SPAs
MIT License
5.04k stars 391 forks source link

React-snap not pre-rendering child routes [Vue] #523

Open OSquiddy opened 3 years ago

OSquiddy commented 3 years ago

Bug Report

Current Behavior

When postbuild runs, react-snap crawls 3 pages. ['/login', '/', '/404.html']. I have a bunch of child routes that I want to be pre-rendered, but those aren't being crawled.

Reproducible demo

I'm interning with a company, so I'm not allowed to post their software online, but I'm working on recreating the issue in a personal repo. As soon as I have that, I'll update this post, or take it down and reupload a new one. But in the meantime, if someone has faced something similar and know how to solve it, that'd be great to hear

Expected behavior/code

I expected all routes specified in the index.js file to be pre-rendered.

Possible Solution

I'm new to puppeteer, but I think a possible reason for this is that the child pages I need pre-rendered are hidden behind a login screen. I was searching for a way to provide credentials to puppeteer so that it can access those pages, and saw that it is possible. So maybe if you could provide some sort of options, in which we pass login info to react-snap, that might work.

theoephraim commented 3 years ago

This tool works by scraping the site and following any links it finds, so if those links aren't visible anywhere until login, then how can it find them?

A few options