pulumi-aws
pulumi-aws copied to clipboard
Directly importing a type leads to exception
If I try to do this
import { Table } from "@pulumi/aws/dynamodb";
new Table(...);
rather than this
import * as aws from "@pulumi/aws";
new aws.dynamodb.Table(...);
I receive the following error
Running program '...' failed with an unhandled exception:
TypeError: Class extends value undefined is not a constructor or null
at Object.<anonymous> (.../node_modules/@pulumi/cloudwatch/eventRuleMixins.ts:70:55)
at Module._compile (module.js:573:30)
at Object.Module._extensions..js (module.js:584:10)
at Module.load (module.js:507:32)
at tryModuleLoad (module.js:470:12)
at Function.Module._load (module.js:462:3)
at Module.require (module.js:517:17)
at require (internal/module.js:11:18)
at Object.<anonymous> (.../node_modules/@pulumi/cloudwatch/cloudwatchMixins.ts:16:1)
at Module._compile (module.js:573:30)
I assume this is an import ordering issue and might not be something we can fix. If it is fixable, however, that would be nice, as the former import style is preferable sometimes.
I think this may be easy to fix. The main issue is that we generate our index.ts in these cloud providers such that they import their own directory files in alphabetical order. This can be highly problematic with ordering.
I solved this in Azure (where it actually was blocking us) by making all the mixins called zMixins.ts
so they would be mixed in at the end, after all the normal code had loaded. I think that should fix the issue here.
Great! Not super urgent, obviously, but probably a nice thing to fix eventually.
Had this same issue importing aws.s3.Bucket
.
Had this same issue importing aws.cloudwatch.LogGroup
I have the same problem with aws.cloudwatch.LogGroup
.
Figured out temporary fix which is probably better than importing * from aws package:
import { cloudwatch } from "@pulumi/aws";
new cloudwatch.LogGroup(...)
Any updates on this? I am also having this issue.
Actively working on this. Blocked for the moment b/c we need to update the pulumi-terraform-bridge > 3.26.1.
Very annoying issue that has been around for almost three years now. Any plans of fixing it?
+1, still an issue on pulumi v3.43.1 with "@pulumi/aws": "5.17.0"