Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

long import breaks build #146

Open
stephen-harris opened this issue Oct 12, 2023 · 0 comments · May be fixed by #147
Open

long import breaks build #146

stephen-harris opened this issue Oct 12, 2023 · 0 comments · May be fixed by #147

Comments

@stephen-harris
Copy link

I got this error when trying to build a typescript project using @ovotech/castle:

node_modules/@ovotech/castle/node_modules/@ovotech/avro-kafkajs/dist/AvroTransformBatch.d.ts:4:23 - error TS2497: This module can only be referenced with ECMAScript imports/exports by turning on the 'esModuleInterop' flag and referencing its default export.
4 import * as Long from 'long';

Using node 20.5.1 and typescript 5.1.6 with esModuleInterop enabled in tsconfig.json.

I think its related to this issue. If I replace the offending line:

import * as Long from 'long';

with

import Long = require('long');

The build completes

stephen-harris added a commit to stephen-harris/castle that referenced this issue Oct 12, 2023
@stephen-harris stephen-harris linked a pull request Oct 12, 2023 that will close this issue
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant