I am dealing with a simple class
export default class Scott {
hello() {
let color: string = "blue";
return true;
}
}
But running Webpack 4 results in this error message: ERROR in ./src/js/test.ts Module parse failed: Unexpected token (3:17) An appropriate loader may be needed to handle this file type.
Changing the code from "let" to let color = "blue"; allows it to work. Every time I attempt to add a type, I encounter the unexpected token issue.
Do I need to include something specific in the tsconfig file to resolve this?