-
Notifications
You must be signed in to change notification settings - Fork 99
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
TS4082: Default export of the module has or is using private name 'Ember.Helper' #133
Comments
import { helper } from '@ember/component/helper';
export function fooHelper(params/*, hash*/) {
return params;
}
export default helper(fooHelper); |
There's been a bunch of motion in the past couple weeks to make the declaration emitter more helpful in these kinds of scenarios, but it looks like for names in other modules, things are still open: microsoft/TypeScript#9944. In the meantime, the workaround here is to change that import to |
Oh, 🤦♂️ – I finally understand the privacy problem here. (For other readers who may have been confused: it's because in the specific context of the module Ugh. |
🎉 Looks like this will be fixed in TS 2.9 microsoft/TypeScript#24071 |
This may or may not actually be fixed by more recent TS releases, but at some point we solved this particular problem by declaring the return type of The overall problem still exists in both 2.9 and most 3.0 beta I checked ( |
Not sure if this is helpful in the context of Ember, but a google search brought me here when facing the same issue. In react land, if I have something like this:
I get the same error message:
|
I'm having the same problem you describe @Roustalski. I wrote up an attempt at a repro here microsoft/TypeScript#24071 (comment) FWIW your solution does work for me, but I'd much rather not have to instruct engineers on the how and why they need to re-export variables and instead let the Typescript compiler do that for them. |
I've opened a request to fix issues like these in TypeScript by bringing declaration files to parity with language features. microsoft/TypeScript#35822 |
Long since resolved by fixing type declarations in DefinitelyTyped and – more importantly – publishing types from Ember’s source. |
When trying to generate declarations for an addon that exposes a helper with any of the 2.8 series of
@types/ember
releases, I see the following error:To reproduce:
The text was updated successfully, but these errors were encountered: