Closed
Description
Guidelines
- Please search other issues to make sure this bug has not already been reported.
Describe the bug
Typescript compiler complains about inferred type of result of .subclass
not being portable
similar issue was reported in #18 and #32
can be fixed with pnpm patch like this:
diff --git a/build/src/main.d.ts b/build/src/main.d.ts
index 02fa22b354cb256d8cbfabe4c3fe20d53a9995e9..625fea03ec727e545c619b16f9d60bdb6a5f008b 100644
--- a/build/src/main.d.ts
+++ b/build/src/main.d.ts
@@ -7,7 +7,7 @@ export type { InstanceOptions } from './options/instance.js'
export type { MethodOptions } from './options/method.js'
export type { Info } from './plugins/info/main.js'
export type { Plugin } from './plugins/shape/main.js'
-export type { ErrorClass }
+export type { ErrorClass, SpecificErrorClass }
/**
* Top-level `ErrorClass`.
Steps to reproduce
import ModernError from 'modern-errors';
import modernErrorsSerialize from 'modern-errors-serialize';
export const BaseError = ModernError.subclass('BaseError', { plugins: [modernErrorsSerialize], serialize: { exclude: ['stack', 'pluginsOpts'] } });
export const UnknownError = BaseError.subclass('UnknownError');
Environment
System:
OS: macOS 15.3.2
CPU: (16) arm64 Apple M3 Max
Memory: 6.74 GB / 48.00 GB
Shell: 5.9 - /bin/zsh
Binaries:
Node: 22.14.0 - ~/Library/pnpm/node
npm: 10.9.2 - ~/Library/pnpm/npm
pnpm: 10.8.0 - ~/Library/pnpm/pnpm
Browsers:
Chrome: 135.0.7049.96
Safari: 18.3.1
npmPackages:
modern-errors: ^7.0.3 => 7.0.3
Pull request (optional)
- I can submit a pull request.