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

Javascript not being executed after build #251

Closed
KrisCoulson opened this issue Sep 5, 2018 · 7 comments
Closed

Javascript not being executed after build #251

KrisCoulson opened this issue Sep 5, 2018 · 7 comments

Comments

@KrisCoulson
Copy link

I currently have a create-react-app that is not ejected. Our react app is pretty standard with a few dynamic imports at certain paths. After running the build script and react-snap post build the site gets compiled and looks great and can be easily navigated.

The issue seems to be that none of the javascript works.

The homepage does not have any dynamic content just a header carousel but the images no longer rotate and we have a few accordions that no longer function.

Is there anything that we are doing wrong? Or an option that I am missing?

@stereobooster
Copy link
Owner

Did you check console in production, maybe JS is there it just some kind of error. Or HTML itself doesn't contain links to JS. If this is later option, please config of react-snap if any and version of create-react-app

@KrisCoulson
Copy link
Author

KrisCoulson commented Sep 5, 2018

Yeah, In production environment the js is being bundled and chunked and appears to be inserted as link with a preload attribute.

No errors in console and 2 warnings that looked like so

The resource [...] was preloaded using link preload but not used within a few seconds from the window's load event.

I didn't setup much of a react-snap config I followed the basic zero config guidelines. I did try to implement loadable-components although I wasn't receiving flashes of content so I don't think that pertained to me.

create-react-app is at 1.1.4

@stereobooster
Copy link
Owner

I'm not sure how I can help you here without actual example of the error.

@KrisCoulson
Copy link
Author

Okay I will see if I can, work out a reproducible example.

@stereobooster
Copy link
Owner

Do you use latest CRA2? This can be the issue #252

@stereobooster
Copy link
Owner

I hope this is fixed in v1.19.0. If not feel free to reopen

@KrisCoulson
Copy link
Author

Hey sorry I never got back to you after upgrading and running the build it seemed to work! Thank you for your support!

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