Comments (5)
Update: I've found sindresorhus/memoize#31 (comment) (thanks @smockle)
from aggregate-error.
This is not the place to ask for general TypeScript support.
from aggregate-error.
Considering the way this library is exposing AggregateError, Is there a way to import AggregateError in a ESModule way as Typescript type (so, no const AggreagateError = require('aggregate-error') and without enabling esModuleInterop option?
I don't think that's possible, no. That is indeed a weird limitation though. I would have expected
import type AggreagateError = require('aggregate-error')
to work. I would bring this up with the TS team.
You are totally right. Sorry for "spamming" issues here. I will address this question to the proper TypeScript channel.
Thanks for your attention and support ❤️
from aggregate-error.
Considering the way this library is exposing AggregateError, Is there a way to import AggregateError in a ESModule way as Typescript type (so, no const AggreagateError = require('aggregate-error') and without enabling esModuleInterop option?
I don't think that's possible, no. That is indeed a weird limitation though. I would have expected import type AggreagateError = require('aggregate-error')
to work. I would bring this up with the TS team.
from aggregate-error.
@sindresorhus the current CommonJS-style export makes aggregate-error
hard to consume for ES Module-style libraries such as all the @octokit/*
modules. Every consumer of e.g. @octokit/webhooks
will have to add skipLibCheck: true
to their TSConfig settings, there is nothing on our side that we can do.
A workaround was kindly suggested by @smockle via https://github.com/smockle/aggregate-error-test/: but it requires us to override aggregate-error
's type definitions, which puts the burden on us to keep it up-to-date with the implementation.
I understand the change was done here: #9 which I think references sindresorhus/p-cancelable#19, but I don't see the reason why you decided to make that change? Is there a discussion somewhere that I can learn more about your reasoning?
from aggregate-error.
Related Issues (11)
- Handling errors without stacks HOT 2
- Add message argument HOT 1
- low level browsers do not support private-methods HOT 1
- Use native AggregateError if available HOT 1
- Tests are failing on master HOT 2
- support es5 syntax HOT 1
- Thoughts on requiring Node 14? HOT 2
- Update clean-stack dependency to latest version
- Make it more spec compliant HOT 15
- message generation breaks when AbortError/Error without stack is encountered HOT 4
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from aggregate-error.