In my Vue2 App, I encountered an issue when trying to import a class with a static property from a separate file.
export class TestUnit {
static testVar = "test";
}
Upon attempting to import the class using:
import { TestUnit } from "../../poco/classes/TestUnit";
I received a "Failed to compile" error with the message:
Module parse failed: Unexpected token (2:16)
You may need an appropriate loader to handle this file type, currently no loaders are configured to process this file. See https://webpack.js.org/concepts#loaders
| export class TestUnit {
> static testVar = "test";
After searching for a solution, I couldn't find one. Any ideas on what might be causing this issue?
Update: Interestingly, static methods in the TestUnit class are functioning properly:
static test() { return "test" };
This adds to my confusion.