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

react-snapshot not crawling nested detail pages #92

Open
AaronCCWong opened this issue Dec 28, 2017 · 6 comments
Open

react-snapshot not crawling nested detail pages #92

AaronCCWong opened this issue Dec 28, 2017 · 6 comments

Comments

@AaronCCWong
Copy link

AaronCCWong commented Dec 28, 2017

I have routes of the form

/
/todos
/todos/1
/todos/2

and I have noticed that react snapshot does not create an html page for /todos/:id. Is there anyway to fix this aside from adding into package.json the explicit paths /todos/1 and /todos/2?

@stereobooster
Copy link

from readme

React-snapshot will crawl all links that it finds. You can create "site map" page, which will contain links to all pages.

@AaronCCWong
Copy link
Author

AaronCCWong commented Dec 28, 2017

Not sure how that helps if I have dynamic ids with 50,000 todos.

React-snapshot is also not able to see the links.

@stereobooster
Copy link

React-snapshot is also not able to see the links.

This sounds like a bug. Provide reproducible example.

@AaronCCWong
Copy link
Author

@stereobooster Thank you for responding.

I apologize for the confusion. React-snapshot is not able to see the links because they are dynamic. They are only added to the page when the backend returns a list of todos. The reason it is not seen is because my backend server blocks any request from unknown domains so the fake browser that react-snapshot uses will not get a list of todos.

@stereobooster
Copy link

  1. I suppose you want to whitelist react-snapshot. Also as of now react-snapshot uses default jsdom user agent, but this is possible to change.
  2. There is an issue with async data V2 API — Async snapshots #30

@codeplus254
Copy link

@AaronCCWong I know I'm late for the party but had similar issue for the last three days and boy haven't I tried out everything. Turns out the code looks for either with href or <iframe> with src attribute. My case, I didn't have either, just had a button. It took only 15 minutes or less going through the react-snapshot code-base to find out why it couldn't crawl through my dynamically generated pages. This was after 3 gruesome days of trying to find out why my build left all dynamically generated pages.

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

3 participants