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

error TS4023 when emitting types declaration files #10

Closed
1 task done
jgoux opened this issue Jun 3, 2022 · 0 comments · Fixed by #11
Closed
1 task done

error TS4023 when emitting types declaration files #10

jgoux opened this issue Jun 3, 2022 · 0 comments · Fixed by #11
Labels
bug Something isn't working

Comments

@jgoux
Copy link
Contributor

jgoux commented Jun 3, 2022

Bug description

When running the command:

tsc --emitDeclarationOnly --declaration --declarationMap

to build the project and obtain my types declaration files, I got these errors:

> tsc --emitDeclarationOnly --declaration --declarationMap

index.ts:3:14 - error TS4023: Exported variable 'projectCreateCommand' has or is using name 'Renderers' from external module "/Users/jgoux/Documents/code/cleye-repro/node_modules/.pnpm/cleye@1.2.0/node_modules/cleye/dist/index" but cannot be named.

3 export const projectCreateCommand = command(
               ~~~~~~~~~~~~~~~~~~~~

index.ts:3:14 - error TS4023: Exported variable 'projectCreateCommand' has or is using name 'parsedType' from external module "/Users/jgoux/Documents/code/cleye-repro/node_modules/.pnpm/cleye@1.2.0/node_modules/cleye/dist/index" but cannot be named.

3 export const projectCreateCommand = command(
               ~~~~~~~~~~~~~~~~~~~~


Found 2 errors in the same file, starting at: index.ts:3

I've found these corresponding issues on TypeScript repository:

Seems like the internals of the library have to be exposed in order to TypeScript to see them somehow. 🤔

I played a little with your generated index.d.ts and I was able to fix the Renderers error by exposing the type. But for the parsedType, exposing the variable didn't fix it unfortunatly.

Reproduction

I've set up a repository with a minimal reproduction: https://github.com/jgoux/cleye-repro

Node.js package manager

pnpm

Environment

System:
    OS: macOS 12.4
    CPU: (10) arm64 Apple M1 Pro
    Memory: 141.14 MB / 16.00 GB
    Shell: 5.8.1 - /bin/zsh
  Binaries:
    Node: 16.15.0 - /opt/homebrew/bin/node
    npm: 8.5.5 - /opt/homebrew/bin/npm
  npmPackages:
    cleye: 1.2.0 => 1.2.0

Can you contribute a fix?

  • I’m interested in opening a pull request for this issue.
@jgoux jgoux added the bug Something isn't working label Jun 3, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant