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

[api-extractor] Roll up of default export is not valid TypeScript #1007

Closed
yacinehmito opened this issue Dec 29, 2018 · 1 comment · Fixed by #1008
Closed

[api-extractor] Roll up of default export is not valid TypeScript #1007

yacinehmito opened this issue Dec 29, 2018 · 1 comment · Fixed by #1008
Labels
bug Something isn't working as intended

Comments

@yacinehmito
Copy link
Contributor

yacinehmito commented Dec 29, 2018

Minimal example

Use the following snippet as entry file.

// index.ts
const example = 'foo'

export default example

This outputs:

// index.d.ts
export declare const default = "foo";

There, the TypeScript compiler errors with "Variable declaration expected" because the variable has the name default. To solve the issue the file must be manually edited as to match the following:

declare const example = "foo";

export default example;
@octogonz octogonz added bug Something isn't working as intended help wanted If you're looking to contribute, this issue is a good place to start! and removed help wanted If you're looking to contribute, this issue is a good place to start! labels Jan 2, 2019
@octogonz
Copy link
Collaborator

octogonz commented Jan 2, 2019

Thanks for creating a PR!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working as intended
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants