TypeError while doing server-rendering with minified version
See original GitHub issueIn the dist
version of react-datepicker (minified) there is this:
return je.Utils=("undefined"!=typeof window?window:t).PopperUtils
which results in TypeError: Cannot read property 'PopperUtils' of undefined
Perhaps (and it fixes the problem) the minified version should also have global
there instead of t
, like this:
return je.Utils=("undefined"!=typeof window?window:global).PopperUtils
Issue Analytics
- State:
- Created 6 years ago
- Comments:7
Top Results From Across the Web
How can I find an error in the minified version of a script ...
If you go to that page, you'll see a Javascript error with an unhelpful message: TypeError: 'undefined' is not a function (near '...Animate(t, ......
Read more >Use Any JavaScript Library With Vue.js
When the app runs on the server the window object will be undefined and so attempting to access a property will end with...
Read more >Enable minify setting that time I got js errors on console
When we disable minify setting that time no error on console. We are using WordPress Version 5.6 and w3 cache Version 2.0.1. Any...
Read more >ReactDOMServer
ReactDOMServer. The ReactDOMServer object enables you to render components to static markup. Typically, it's used on a Node server:.
Read more >How to Minify JavaScript — Recommended Tools and ...
JavaScript title with a demo JavaScript code on a computer screen ... The minified version of JavaScript code can reduce the file size...
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
When using
dist/react-datepicker.min.js
, as it already comes packed and minified, theglobal
variable somehow gets lost, producing an error:TypeError: Cannot read property 'PopperUtils' of undefined
To prevent this I’m directly using
lib/datepicker.js
instead.You can either do
import DatePicker from 'react-datepicker/lib/datepicker'
or fork it and changepackage.json
:This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.