I have some files containing TypeScript classes, defined like this
textBox.ts
export class textBox {
//Variables here
//Constructor
constructor(idObj: number, textContent: string) {
//More code
}
}
I have another file, called userSlide.ts, which imports the class textBox like this
userSlide.ts
import { textBox } from "./textBox";
When I run my code, I get this error
ReferenceError: exports is not defined
Edit: Here are the first few lines of the compiled file userSlide.js
"use strict";
exports.__esModule = true;
var textBox_1 = require("./textBox");
var slide_1 = require("./slide");
I'm still new to TypeScript and have no idea how to fix this issue. I tried some other things, but to no effect
I'm using Visual Studio Code and have Node.js installed. I compiled them using the tsc command