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

Error after build: Uncaught TypeError n(...) is not a function (prop-types) #4133

Closed
RobertBolender opened this issue Feb 19, 2018 · 3 comments

Comments

@RobertBolender
Copy link
Contributor

RobertBolender commented Feb 19, 2018

Gatsby: 1.9.202

I haven't been able to reliably reproduce the issue, but thought I'd post this just in case someone else has noticed a similar issue.

More than once, I've noticed that when I load my site after a fresh production build, some of the content will load and some will not. My first thought was that my layout/index.js was loading but not the page content, but upon inspecting the DOM I found that the page elements were there but not fully rendered.

The javascript console included this error:

screenshot_1519078148

Clicking on the first index.js:27 link showed me what appears to be code from the prop-types package, which led me to think it could be related to this prop-types webpack issue

The error persists through page refreshes until I clear the cache with a hard Ctrl+F5 refresh.

I realize that I haven't provided much to go on in terms of reproducing the bug, but would be happy to learn how I can better debug this.

@RobertBolender
Copy link
Contributor Author

On subsequent builds, I have seen other errors, but the visible result is the same: I have a header/footer rendered fully, but the inner contents of each page isn't fully rendered.

Once I clear my cache and refresh, everything goes back to normal.

screenshot_1519089382
screenshot_1519083628

@KyleAMathews
Copy link
Contributor

I'd guess you're caching the JavaScript? https://www.gatsbyjs.org/docs/caching/

@RobertBolender
Copy link
Contributor Author

@KyleAMathews Ah, it appears you are correct. I remember reading that page and so had not implemented any JS caching myself, but I failed to check whether my server setup had caching in place already (and it does). Thanks for the help.

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