-
-
Notifications
You must be signed in to change notification settings - Fork 1.6k
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
Typing errors on 3.13.0 release #898
Comments
The typescript declaration file has changed. |
It's working, thanks ! |
Actually, I still have an issue:
|
I have the same issue. The code appears to be doing |
Same. Pinned raven-js in my package.json to It is working in the raven-tests.ts file because it's really just testing the .d.ts file. |
So, obviously this was caused by #827. Can anything from tsconfig.json be used in your local config? Folks, I need a hand. I don't write TypeScript, and I rely on the community to get these definitions right. |
I'm guessing it's related to this: "compilerOptions": {
"module": "commonjs",
// ...
} |
If I don't have a resolution by EOD I'll back out #827 entirely and publish 3.13.1. |
the reason is your .d.ts describes an ES module, but your source code is a CJS module |
Yep, I understand. So the "fix" is to tell the So is the only solution to go back to the old definitions? Can we amend the existing ones quickly to use the previous export statements? |
you should be able to say that Raven is a CJS module, or switch to ESM completely. |
Options: declare as CJSdeclare module "raven-js" {
export = Raven
} Then move all the exported interfaces to a new .ts file (that typescript users can import) and import into raven.d.ts declare as ESMThen to support import objectAssign from 'object-assign';
const assign = Object.assign || objectAssign;
const Raven = ...
export default Raven
module.exports = assign(Raven, module.exports); |
It's definitely going to stay as CommonJS.
Can anyone try 3.13.0 with the changes Ben suggested above?
|
Thomas, sorry :)
|
@benvinegar I'd recommend the ESM + module.exports = Object.assign trick. |
I'm going to revert for now, publish 3.13.1, then look into getting this done for the future. |
3.13.1 is published. Keeping this open because I want to solve this TypeScript problem properly – and hopefully for the last time. |
Ouch, I'm really sorry to have caused this trouble. @graingert could you please open a PR with the CJS-Variant you suggested to get it fixed? |
While Typescript support is being looked at, I'd like to reflag my PR #736 from last year. Right now we're stuck on Even in that old version, we have to import it in a very hacky way:
Ideally with proper typings, we'd be able to do something like this:
My PR #736 demonstrates how this can be done. |
Do you want to request a feature or report a bug?
Bug
What is the current behavior?
The last release (3.13.0) seems to have broken some type definitions.
In a
.ts
file compiled withtsc
In a get ->
I see the same error in Visual Code.
What is the expected behavior?
This was working fine in
3.12
.I saw in the release page, that many changes occurred during the last release on
ts
files so I might not using it correctly anymore.Thanks for your time, and do not hesitate if you need more information.
The text was updated successfully, but these errors were encountered: