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

[7.0.0] 'Queue' refers to a value, but is being used as a type here. Did you mean 'typeof Queue'? #807

Closed
charlesfries opened this issue Jun 13, 2022 · 1 comment
Labels

Comments

@charlesfries
Copy link

charlesfries commented Jun 13, 2022

Seeing this TypeScript build time error after upgrading to 7.0.0 and updating my imports:

node_modules/ember-file-upload/dist/upload-file-34ababbf.d.ts:12:13 - error TS2749: 'Queue' refers 
to a value, but is being used as a type here. Did you mean 'typeof Queue'?

12     queue?: Queue;

The error appears 6 times and comes from occurrences in dist/upload-file-34ababbf.d.ts:, dist/file-queue-49328ee3.d.ts, and dist/interfaces-27a5f801.d.ts.

I also am trying to import from ember-file-upload/dist rather than ember-file-upload so I can get the types. Is this not recommended?

import { UploadFile } from 'ember-file-upload'; // doesn't work in TypeScript
import { UploadFile } from 'ember-file-upload/dist'; // works in TypeScript
"ember-cli": "~4.4.0",
"ember-source": "~3.28.9",
"typescript": "4.6.3",
@gilest gilest added the bug label Jun 25, 2022
gilest added a commit that referenced this issue Jun 25, 2022
Reported in #807

Unfortunately this issue doesn't show up in test builds since our test app doesn't use ts. Will need to consider a TypeScript testing strategy 🤔

Was able to repro the issue by creating ember app and installing ember-cli-typescript.

Corrected type exports by named (rather than default) exporting all public modules. Corrected a few instances where a full module was imported where only its type signature was used.

Also added a missing typesVersions field to package.json.

I'm not very experienced with TypeScript or publishing types but this does fix all issues with the repro I created.
@gilest
Copy link
Collaborator

gilest commented Jun 25, 2022

Thanks for reporting! This is hopefully fixed in 7.0.1

@gilest gilest closed this as completed Jun 25, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants