-
-
Notifications
You must be signed in to change notification settings - Fork 599
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]: Default export type not being picked up with module: "nodenext"
#1329
Comments
I have the same problem: are there any workarounds before an official support is complete? |
Seems like this one is completely ignored. When I created issue without repro I received feedback immediately. No one checked this issue since I wasted my time on repro |
I'm sorry I don't understand what you mean, exactly: I'm unable to understand any of your workarounds: are you saying I ignored them? |
Ran into this as well.. Too bad it's ignored! For now, I'm using the following hacky workaround: import virtualDefault from '@rollup/plugin-virtual';
import aliasDefault from '@rollup/plugin-alias';
const virtual = virtualDefault as unknown as virtualDefault.default;
const alias = aliasDefault as unknown as aliasDefault.default; |
adding |
Per algolia/algoliasearch-client-javascript#1431 (comment) and https://arethetypeswrong.github.io/ the problem is not necessarily node.js, but rather the export statement. I can't say I fully understand it myself, but take a look. |
I've described the issue in more detail here #1541, including the exact reason why it happens and the way to fix it (skip over to "Additional Details" for it). I'm not familiar enough with this repository to write a fix, since it's almost entirely about the way the packages are distributed, and not the code itself. |
OK. Just be aware this is unlikely to see a resolution without community contribution |
Setting up publint for the package would also catch this. For example: |
Expected Behavior
Typing should be picked-up
Actual Behavior
Additional Information
Steps to reproduct:
"type": "module"
topackage.json
3 possible fixes:
export default function typescript
=>export = typescript
;"module": "nodenext"
compatible fastify/fastify-cookie#184I've used this thin wrapper for fixing typings before, might be helpful: https://github.com/wight554/vite-plugin-typescript/blob/main/index.d.ts
The text was updated successfully, but these errors were encountered: