privatenumber / tsx

⚡️ TypeScript Execute | The easiest way to run TypeScript in Node.js
https://tsx.is
MIT License
9.77k stars 154 forks source link

ESM only: The requested module './generated/index.js' does not provide an export named 'ConfigurationSetting' #630

Closed jeremymeng closed 3 months ago

jeremymeng commented 3 months ago

Acknowledgements

Minimal reproduction URL

https://github.com/jeremymeng/tsx-repo

Problem & expected behavior (under 200 words)

Skip this section and let your reproduction do the talking...

Not sure whether it is related, but we are using export * from "./models/index.js"; pattern in ./generated/index.js

But if you really need to explain, keep it under 200 words:

Bugs are expected to be fixed by those affected by it

Compensating engineering work will speed up resolution and support the project

privatenumber commented 3 months ago

This is not a bug. The error happens because the TS compiler cant tell if you're importing a type or a run-time value.

To be explicit, you can use import type.

For the TS compiler to warn you about this, you can enable https://www.typescriptlang.org/tsconfig/#verbatimModuleSyntax