I am trying to get started with Typescript to develop Electron. After struggling with getting text for node and jquery, I finally got a free .ts file.
The problem is that when I run my application, I get this error:
index.js:2 Uncaught ReferenceError: exports is not defined
These are the first two lines in index.js:
"use strict"; Object.defineProperty(exports, "__esModule", { value: true });
I do not know what this line is. Typescript added it when compiling. My application works fine if I remove it.
How to get rid of this error?
Oh, and here is my tsconfig, if relevant.
{ "compilerOptions": { "target": "es6", "module": "commonjs", "moduleResolution": "node", "isolatedModules": false, "jsx": "react", "experimentalDecorators": true, "emitDecoratorMetadata": true, "declaration": false, "noImplicitAny": false, "noImplicitUseStrict": false, "removeComments": true, "noLib": false, "preserveConstEnums": true, "suppressImplicitAnyIndexErrors": true }, "exclude": [ "node_modules", "typings/browser", "typings/browser.d.ts" ], "compileOnSave": true, "buildOnSave": false, "atom": { "rewriteTsconfig": false } }
javascript typescript
Blargmode
source share