-
Notifications
You must be signed in to change notification settings - Fork 225
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
Typescript - Unable to export Agent#lambda(...)
from client library due to absence of exported inline AwsLambda.Context.
#977
Comments
I tried your example in VS Code and VS Code didn't show any errors for that code. When exactly are you getting it?
That's correct. When we added the Because we use If you know of any way we can do it without having to change the actual CommonJS export, please let me know :) |
Thank you for such a quick response! I get the error when I try to build ( Hmmm.. the fact you don't see the error made me check if it's because I'm using project references. That's indeed the issue. When using project references, we have to set I'm not sure how we'd address this without breaking backwards compatibility. Maybe something to keep in mind for when we do a major version upgrade :) I'll see if I can come up with a less hacky solution over here and share back! Thanks again!! |
Hello, I'm encountering the same issue when I try to reexport import * as ElasticAPM from 'elastic-apm-node'
export type APM = typeof ElasticAPM
export function apmFactory (logger: Logger): APM {
return ElasticAPM.start({
ignoreUrls: ['/healthcheck'],
ignoreUserAgents: [],
logger,
})
} give me this compilation error: |
I've opened a request to fix issues like these in TypeScript by bringing declaration files to parity with language features. microsoft/TypeScript#35822 |
This is pain in the butt, just ran into this... how is it that this is the only library out of hundreds I've seen that decides to break TS in such a weird way? Why not just fix your declaration files so paying customers can use types without hassle?
Just bump the major version, and change how the exports from your declaration file are done, it's worth it for such a critical issue as it renders your types useless outside an extremely simple use case. |
Is your feature request related to a problem?
It's currently not possible to export a function form a typescript module when calling
Agent#lambda
because the interfaceAwsLambda#Context
(defined in-line) is not exported inindex.d.ts
.Describe the solution you'd like
AwsLambda
could potentially be exported (?). Might be tricky since we currently export a default agent withexport =
.Describe alternatives you've considered
as any
when exporting function from typescript file.Agent
The text was updated successfully, but these errors were encountered: