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

Regression in 1.5.4: SyntaxError: The requested module '@inquirer/type' does not provide an export named 'CancelablePromise' #1553

Closed
johnpc opened this issue Sep 16, 2024 · 1 comment

Comments

@johnpc
Copy link

johnpc commented Sep 16, 2024

I am using AWS Amplify's CLI tool (ampx) which is installed via npm. Since the release of @inquirer/type@1.5.4 a couple hours ago, the CLI tool is unusable:

➜  git:(main) ✗ npx ampx --help
file:///Users/xss/repo/image-host/node_modules/@inquirer/core/dist/esm/lib/create-prompt.mjs:2
import { CancelablePromise } from '@inquirer/type';
         ^^^^^^^^^^^^^^^^^
SyntaxError: The requested module '@inquirer/type' does not provide an export named 'CancelablePromise'
    at ModuleJob._instantiate (node:internal/modules/esm/module_job:123:21)
    at async ModuleJob.run (node:internal/modules/esm/module_job:191:5)
    at async ModuleLoader.import (node:internal/modules/esm/loader:336:24)
    at async loadESM (node:internal/process/esm_loader:34:7)
    at async handleMainPromise (node:internal/modules/run_main:106:12)

Node.js v18.19.0

I have confirmed that I am able to fix this issue by downgrading inquirer via

  "overrides": {
    "@inquirer/type": "1.5.3"
  },

Full repro steps:

$ npx create-next-app@latest temp-sep15-repo && cd temp-sep15-repo
$ npm create amplify
$ npx ampx help

file:///Users/xss/repo/temp-sep15-repo/node_modules/@inquirer/core/dist/esm/lib/create-prompt.mjs:2
import { CancelablePromise } from '@inquirer/type';
         ^^^^^^^^^^^^^^^^^
SyntaxError: The requested module '@inquirer/type' does not provide an export named 'CancelablePromise'
    at ModuleJob._instantiate (node:internal/modules/esm/module_job:123:21)
    at async ModuleJob.run (node:internal/modules/esm/module_job:191:5)
    at async ModuleLoader.import (node:internal/modules/esm/loader:336:24)
    at async loadESM (node:internal/process/esm_loader:34:7)
    at async handleMainPromise (node:internal/modules/run_main:106:12)

Node.js v18.19.0
SBoudrias added a commit that referenced this issue Sep 16, 2024
Prevent reoccurence of issues similar to #1553
@SBoudrias
Copy link
Owner

Thanks for the report. @inquirer/type@1.5.4 should've been a major; it's a human mistake.

It's always a bit tricky to then deal with history given the forward only nature of packages, but I think there's a fix out now.

  1. @inquirer/type@1.5.3 is republished as 1.5.5 https://www.npmjs.com/package/@inquirer/type/v/1.5.5 (content seems correct.) I don't think that'll break the in-between versions relying on 1.5.4 - but luckily those were all major, so it should reduce the radius of impact.
  2. @inquirer/type@1.5.4 is republished as 2.0.0, including patches release for all dependencies.

Lastly, I made the dependencies within this monorepo strict, so it reduces the risk of that type of issue reoccurring. Thanks for the timely report!! This bug still up Monday would've caused a lot of headache 😬😱

Note: Will still accept help migrating this repo from lerna to changeset if someone wanna start a PR.

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

No branches or pull requests

2 participants