Typescript -> ReferenceError: exports is not defined
Is this a bug report?
yes
... followed the instructions for converting to TS and they don't work.
I get "ReferenceError: exports is not defined"
Tried restarting the dev server ... that doesn't work.
Let it create its own tsconfig.json and that didn't work either.
Hi @burtonator, interesting. A colleague of mine did the same thing this week and didn't have any issues, so I'm inclined to believe this might be something within your project.
Can you please share your project? Or an example repository for reproduction?
If you have exports in your code, that should be export - but otherwise, we'll need to have a look at the code to understand the exact problem sorry.
I had the same problem, had to add export = null at the bottom of my index.tsx because TS generates code using Object.defineProperty(exports.default) or something like that, and exports isn't defined. Adding the export = null replaces the code with module.exports = null instead so no error!