Skip to content
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

fix: Module '"node:readline"' has no default export. #1276

Closed
wants to merge 3 commits into from
Closed

fix: Module '"node:readline"' has no default export. #1276

wants to merge 3 commits into from

Conversation

saadfrhan
Copy link
Contributor

No description provided.

@codecov
Copy link

codecov bot commented Aug 3, 2023

Codecov Report

Patch coverage: 100.00% and no project coverage change.

Comparison is base (e7c5bba) 72.33% compared to head (c580982) 72.33%.

Additional details and impacted files
@@           Coverage Diff           @@
##           master    #1276   +/-   ##
=======================================
  Coverage   72.33%   72.33%           
=======================================
  Files          42       42           
  Lines        4110     4110           
  Branches      669      669           
=======================================
  Hits         2973     2973           
  Misses        477      477           
  Partials      660      660           
Files Changed Coverage Δ
packages/core/src/index.mts 80.35% <100.00%> (ø)

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@SBoudrias
Copy link
Owner

@saadfrhan where did you see this? Running under which environment? (and Node.js version?)

It's always been passing CI for Node 16, 18, and 20.

@saadfrhan
Copy link
Contributor Author

saadfrhan commented Aug 3, 2023

@saadfrhan
Copy link
Contributor Author

Tried with the latest LTS version as well, on the terminal.

image

@SBoudrias
Copy link
Owner

SBoudrias commented Aug 3, 2023

I think you need to add this line to your tsconfig:

{
  "compilerOptions": {
    "allowSyntheticDefaultImports": true
  }
}

To provide backwards compatibility, Node.js allows you to import most CommonJS packages with a default import. This flag tells TypeScript that it's okay to use import on CommonJS modules.

You could also consider bumping @type/node - that could be the problem too if very old.

I tried changing this on Inquirer's side to make it easier for users; but then it break elsewhere. So I don't think just the code change within Inquirer will fix it up everywhere in your own codebase. So unfortunately, this feel like a fix that must be applied on users' projects.

@SBoudrias SBoudrias closed this in ef7a66c Aug 3, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants