ShakaCode | ShakaCode Blog | Rails On Maui Blog | Rails | ReactJs | JavaScript | Webpack | Productivity |

Cannot do server side rendering: ERROR in SERVER PRERENDERING Encountered error: "ReferenceError: webpackJsonp is not defined"


#1

ERROR in SERVER PRERENDERING
Encountered error: “ReferenceError: webpackJsonp is not defined”

Whenever I try to prerender a component in react on rails I get the above error.

Everything else in react on rails works fine. This is in reactonrails 6.9

Searched on google but can’t find anything useful as to what is going wrong… no idea where to even try and solve this problem…

Any ideas?


#2

Try this fix:

Be sure to load any “common” files first on your layout! For example, you might be putting common files in a vendor-bundle.js.