You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
import type { JWSHeaderParameters, JWTPayload, KeyLike, SignOptions } from '../types.d';
import ProduceJWT from '../lib/jwt_producer.js';
When specified like this, with an extension, some systems may try to find these imports explicitly with these extensions, but files with such extensions don't exist in relative to the path. However there are files with jwt_producer.d.ts and types.d.ts.
It probably is better to simply remove these extensions as then it should still continue to work, whereas most systems will then try to find imports with several extensions, including .d.ts for type definitions, .ts for sources and .js for transpiled JS files. Change probably should be done at the source level, as the imports in type definitions are reflections of the source, and the source is written in TS, but uses explicit .js or .d import extensions.
To Reproduce
This issue is present in AutoBlocks online editor (Monaco based). While we monkey patched it currently to work more or less correctly, then there are still some weird issues where types are not being loaded correctly by Monaco editor. I can provide additional steps to try it out in AutoBlocks environment if needed.
the bug is happening on latest jose too.
i have searched the issues tracker on github for similar issues and couldn't find anything related.
The text was updated successfully, but these errors were encountered:
Describe the bug
d.ts imports contain file extensions that are redundant and invalid, which makes loading type definitions in some systems work incorrectly.
For example: https://unpkg.com/browse/jose-browser-runtime@3.13.0/dist/types/jwt/sign.d.ts type definition has 2 following imports:
When specified like this, with an extension, some systems may try to find these imports explicitly with these extensions, but files with such extensions don't exist in relative to the path. However there are files with
jwt_producer.d.ts
andtypes.d.ts
.It probably is better to simply remove these extensions as then it should still continue to work, whereas most systems will then try to find imports with several extensions, including
.d.ts
for type definitions,.ts
for sources and.js
for transpiled JS files. Change probably should be done at the source level, as the imports in type definitions are reflections of the source, and the source is written in TS, but uses explicit.js
or.d
import extensions.To Reproduce
This issue is present in AutoBlocks online editor (Monaco based). While we monkey patched it currently to work more or less correctly, then there are still some weird issues where types are not being loaded correctly by Monaco editor. I can provide additional steps to try it out in AutoBlocks environment if needed.
jose
too.The text was updated successfully, but these errors were encountered: