My server went suddenly blank and i got following error message in browser console:
Uncaught TypeError: Cannot read property 'current' of undefined react-dom.production.min.js:134 at Vg...
What can be the issue? Something wrong with the react CDN server`?
My script in the html is:
<script crossorigin src="https://unpkg.com/react-dom@16/umd/react-dom.production.min.js"></script>
In development mode the message is (from my development enviroment):
(index):1 Access to script at 'https://unpkg.com/[email protected]/umd/react-dom.development.js' (redirected from 'https://unpkg.com/react-dom@16/umd/react-dom.development.js') from origin 'http://localhost' has been blocked by CORS policy: No 'Access-Control-Allow-Origin' header is present on the requested resource. unpkg.com/[email protected]/umd/react-dom.development.js:1 Failed to load resource: net::ERR_FAILED App.js:63 Uncaught ReferenceError: ReactDOM is not defined at App.js:63
My react components are translated from jsx to js with Babel web page. Presets: es2015, stage-2
I got the main application up by dropping "crossorigin" from the script. But it works only in development mode, not in production mode.Server is up but slow. And it shows
[Violation] 'react-invokeguardedcallback' handler took 262ms react-dom.development.js:128
Headers in production mode
Request URL: https://unpkg.com/[email protected]/umd/react-dom.production.min.js
Request Method: GET
Status Code: 200
Remote Address: 104.16.126.175:443
Referrer Policy: no-referrer-when-downgrade
access-control-allow-origin: *
cache-control: public, max-age=31536000
cf-cache-status: HIT
cf-ray: 4a4e1438e86e5af7-HEL
content-encoding: br
content-type: application/javascript; charset=utf-8
date: Wed, 06 Feb 2019 13:49:15 GMT
etag: W/"1a24b-tnTtN6dcAkNhpzBK8ZBEsa24AAw"
expect-ct: max-age=604800, report-uri="https://report-uri.cloudflare.com/cdn-cgi/beacon/expect-ct"
last-modified: Sat, 26 Oct 1985 08:15:00 GMT
server: cloudflare
status: 200
strict-transport-security: max-age=31536000; includeSubDomains; preload
vary: Accept-Encoding
x-cloud-trace-context: 7ef73148e43be758d63b9525cae9fe1c
x-content-type-options: nosniff
:authority: unpkg.com
:method: GET
:path: /[email protected]/umd/react-dom.production.min.js
:scheme: https
accept: */*
accept-encoding: gzip, deflate, br
accept-language: fi-FI,fi;q=0.9,en-US;q=0.8,en;q=0.7
origin: https://www.suomiverkko.online
referer: https://www.suomiverkko.online/
user-agent: Mozilla/5.0 (Windows NT 6.3; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/70.0.3538.102 Safari/537.36 OPR/57.0.3098.106
It started working when i load these files from my own server. Obviously the issue was some sort of network issue somewhere.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With