Anyone seen this error before? ```TypeError: Clas...
# typescript
w
Anyone seen this error before?
Copy code
TypeError: Class constructor ComponentResource cannot be invoked without 'new
b
can you share your code?
w
Its pretty hairy.
Basically I am extending ComponentResource with my own class, and then extending off of that class for any other resources I want to create.
I will see if I can share it, since there isn’t anything sensitive, but its not public
I thought perhaps because I made my base class abstract, it was that. But I don’t think its that issue any more, since its still happening, abstract or not.
Copy code
{
  "$schema": "<https://json.schemastore.org/tsconfig>",
  "display": "Node 12",
  "include": [
    "src/**/*",
    "index.ts"
  ],
  "exclude": [
    "node_modules",
    "**/*.spec.ts"
  ],
  "compilerOptions": {
    "baseUrl": ".",
    "paths": {
      "@ops/app/*": [
        "src/app/*"
      ],
      "@ops/app": [
        "src/app/index"
      ],
      "@ops/core/*": [
        "src/core/*"
      ],
      "@ops/core": [
        "src/core/index"
      ],
      "@ops/infra/*": [
        "src/infra/*"
      ],
      "@ops/infra": [
        "src/infra/index"
      ],
      "@ops/pulumi/*": [
        "src/pulumi/*"
      ],
      "@ops/pulumi": [
        "src/pulumi/index"
      ]
    },
    "outDir": "./dist",
    "lib": [
      "es2020"
    ],
    "types": [
      "reflect-metadata",
      "jest",
      "node"
    ],
    "module": "commonjs",
    "target": "es2019",
    "alwaysStrict": true,
    "strict": true,
    "resolveJsonModule": true,
    "esModuleInterop": true,
    "allowSyntheticDefaultImports": true,
    "importHelpers": true,
    "skipLibCheck": true,
    "forceConsistentCasingInFileNames": true,
    "strictPropertyInitialization": false,
    "allowJs": false,
    "moduleResolution": "node",
    "experimentalDecorators": true,
    "emitDecoratorMetadata": true,
    "removeComments": true,
    "sourceMap": true
  }
}
^ This is my tsconfig
b
it looks to me like you just missed a
new
instatiation?
w
@billowy-army-68599 I thought that too. I didn’t see one though. I think I just fixed it though. I accidentally had generated JS files alongside my TS files. I think there was a conflict there, and maybe the JS code was instantiating classes incorrectly, or the modules got confused or something.