3 ms·
So it's caused by a reference to `print` not being what they expected. The create-react-app project maintains a great list of "confusing browser globals" for e
by exogen 7y ago
So it's caused by a reference to `print` not being what they expected.
The create-react-app project maintains a great list of "confusing browser globals" for exactly this situation! https://github.com/facebook/create-react-app/tree/master/packages/confusing-browser-globals https://github.com/facebook/create-react-app/tree/master/pac...
You can use it along with ESLint to detect situations where a variable reference is technically valid (it will refer to the window property) but is probably not what you're intending.
Some of them are really easy to trip over, like `error`, `name`, and `open`. All global properties on the window!
- habosa 7y agoName got me the other day. I was writing typescript and not even targeting the browser but I guess I had browser globals in the .d.ts I had a string like "Hello ${name}" and it would compile but crash at runtime. Wasted a whole day, learned a lot about why even with great tools the JS ecosystem still has some fundamental crap at the bottom.