question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Stream has no exports

See original GitHub issue

tsc fails to compile, StreamEventSource, StreamEventSourceProps missing from aws-lambda-event-sources streams file.

Reproduction Steps

npm install @aws-cdk/core
npm install @aws-cdk/aws-lambda-event-sources
tsc

Error Log

node_modules/@aws-cdk/aws-lambda-event-sources/lib/dynamodb.d.ts:3:10 - error TS2305: Module '"./stream"' has no exported member 'StreamEventSource'.

3 import { StreamEventSource, StreamEventSourceProps } from './stream';
           ~~~~~~~~~~~~~~~~~

node_modules/@aws-cdk/aws-lambda-event-sources/lib/dynamodb.d.ts:3:29 - error TS2305: Module '"./stream"' has no exported member 'StreamEventSourceProps'.

3 import { StreamEventSource, StreamEventSourceProps } from './stream';
                              ~~~~~~~~~~~~~~~~~~~~~~

node_modules/@aws-cdk/aws-lambda-event-sources/lib/kinesis.d.ts:3:10 - error TS2305: Module '"./stream"' has no exported member 'StreamEventSource'.

3 import { StreamEventSource, StreamEventSourceProps } from './stream';
           ~~~~~~~~~~~~~~~~~

node_modules/@aws-cdk/aws-lambda-event-sources/lib/kinesis.d.ts:3:29 - error TS2305: Module '"./stream"' has no exported member 'StreamEventSourceProps'.

3 import { StreamEventSource, StreamEventSourceProps } from './stream';
                              ~~~~~~~~~~~~~~~~~~~~~~

Environment

  • **CLI Version :10.
  • **Framework Version: 10.1.
  • **OS :MacOS
  • **Language : TypeScript

Other

Digging around the node_modules/@aws-cdk/aws-lambda-event-sources/lib/stream.d.ts file shows no exports


This is 🐛 Bug Report

Issue Analytics

  • State:closed
  • Created 4 years ago
  • Reactions:4
  • Comments:13 (11 by maintainers)

github_iconTop GitHub Comments

4reactions
ashwguptcommented, Oct 3, 2019

We also faced the same issue even when not using either of the Kinesis and Dynamo streams but only SqsEventSource.

Looking at the change log of 1.11.0, the merged work of https://github.com/aws/aws-cdk/pull/4260 has removed redundant code in KinesisEventSource and DynamoEventSource into common StreamEventSource, and that looks like causing it.

2reactions
nmussycommented, Oct 3, 2019

Here is an immediate fix in the meantime, using patch-package:

npm i patch-package

tee node_modules/@aws-cdk/aws-lambda-event-sources/lib/stream.d.ts << TS
import lambda = require('@aws-cdk/aws-lambda');
import cdk = require('@aws-cdk/core');
export interface StreamEventSourceProps {
  readonly batchSize?: number;
  readonly startingPosition: lambda.StartingPosition;
  readonly maxBatchingWindow?: cdk.Duration;
}

export declare abstract class StreamEventSource implements lambda.IEventSource {
  readonly props: StreamEventSourceProps;

  protected constructor(props: StreamEventSourceProps);
  public bind(_target: lambda.IFunction): void;
  protected enrichMappingOptions(options: lambda.EventSourceMappingOptions): lambda.EventSourceMappingOptions;
}
TS

npx patch-package @aws-cdk/aws-lambda-event-sources
git add patches/@aws-cdk+aws-lambda-event-sources+1.11.0.patch && git commit

You’ll need to add "postinstall": "patch-package" to your package.json scripts field to ensure that the patch will run after each installation.

Hope that helps!

Read more comments on GitHub >

github_iconTop Results From Across the Web

Stream in NodeJS - javascript - Stack Overflow
I want this behavior to exports the Readable Stream and allow another module to read them. To do this, I have write a...
Read more >
Resolve the "No Export named XYZ found" error in ...
I receive the "No Export named XYZ found" error in AWS CloudFormation when I use Fn::ImportValue in my stack.
Read more >
A stream's role in watershed nutrient export - PNAS
Despite the knowledge that streams can be biogeochemical hot spots, stream element processing has not been experimentally linked to watershed elemental export.
Read more >
[GA4] BigQuery Export - Analytics Help - Google Support
Exporting Data from Google Analytics 4 Properties to BigQuery BigQuery is a ... Streaming export is a best-effort operation and may not include...
Read more >
Export live-streaming files with Final Cut Pro - Apple Support
Changing the title does not change the project or clip name, which is the name used for the exported file. At the bottom...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found