incalculable-diamond-5088
10/14/2019, 3:29 PMTypeError: Class extends value undefined is not a constructor or null
at Object.<anonymous> (/Users/igor/work/some-project/infra/pulumi/node_modules/@pulumi/cloudwatch/eventRuleMixins.ts:70:56)
at Module._compile (internal/modules/cjs/loader.js:868:30)
at Object.Module._extensions..js (internal/modules/cjs/loader.js:879:10)
at Module.load (internal/modules/cjs/loader.js:731:32)
at Function.Module._load (internal/modules/cjs/loader.js:644:12)
at Module.require (internal/modules/cjs/loader.js:771:19)
at require (internal/modules/cjs/helpers.js:68:18)
at Object.<anonymous> (/Users/igor/work/some-project/infra/pulumi/node_modules/@pulumi/cloudwatch/cloudwatchMixins.ts:16:1)
at Module._compile (internal/modules/cjs/loader.js:868:30)
at Object.Module._extensions..js (internal/modules/cjs/loader.js:879:10)
new BucketPolicy('allow-write-by-segment-io', {
bucket: segmentLogs.bucket.id,
policy: segmentLogsPolicy.json,
}, { parent: segmentLogs.bucket })
Here segmentLogs.bucket is an aws.s3.Bucket
function __export(m) {
console.log(m) // <<<-------
for (var p in m) if (!exports.hasOwnProperty(p)) {
console.log(`Exporting ${p}`) // <<<-------
exports[p] = m[p];
}
}
Object.defineProperty(exports, "__esModule", { value: true });
// Export members:
console.log('Importing lambdaMixins') // <<<-------
__export(require("./lambdaMixins"));
// ...
Then only Importing lambdaMixins
is being printed, and none of the Exporting ...
is printed out.
Looks like some sort of circular dependency to meimport { BucketPolicy } from '@pulumi/aws/s3'
import { getPolicyDocument } from '@pulumi/aws/iam'
const policy = getPolicyDocument(...)
new BucketPolicy(..., { ..., policy: policy.json })
I modified it to the following and it worked:
import * as aws from '@pulumi/aws'
const policy = aws.iam.getPolicyDocument(...)
new aws.s3.BucketPolicy(..., { ..., policy: policy.json })
Looks like a typescript problem