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

Terminal error while running npx commands (from meow dependency) #44

Closed
andre-lergier opened this issue May 18, 2023 · 3 comments
Closed
Labels
bug Something isn't working

Comments

@andre-lergier
Copy link

After updating to the lastest version I can no longer run npx prismic-ts-codegen.
If I try to build the types the following error appears:

➜ npx prismic-ts-codegen init
file:///Users/andrelergier/Developer/test/node_modules/meow/source/options.js:52
		throw new Error(errorMessages.join('\n'));
		      ^

Error: The option `alias` has been renamed to `shortFlag`. The following flags need to be updated: `--config`
    at validateOptions (file:///Users/andrelergier/Developer/test/node_modules/meow/source/options.js:52:9)
    at buildOptions (file:///Users/andrelergier/Developer/test/node_modules/meow/source/options.js:87:2)
    at meow (file:///Users/andrelergier/Developer/test/node_modules/meow/source/index.js:91:24)
    at file:///Users/andrelergier/Developer/test/node_modules/prismic-ts-codegen/dist/cli.js:12:13
    at ModuleJob.run (node:internal/modules/esm/module_job:194:25)

Node.js v18.16.0

Versions

  • @prismicio/client: 7.0.0
  • prismic-ts-codegen: 0.1.7
  • node: v18.16.0

Reproduction

I reproduced the issue with creating a new repository and following the steps described in the readme.

As soon as I run the following command the error already appears as well:

npx prismic-ts-codegen init
Additional Details

package.json-File:

{
  "name": "slice-library",
  "version": "0.1.0",
  "main": "index.ts",
  "types": "index.ts",
  "scripts": {
    "lint": "eslint \"**/*.ts*\"",
    "build": "npx prismic-ts-codegen && npm run lint"
  },
  "dependencies": {
    "@prismicio/client": "^7.0.0",
    "@prismicio/react": "^2.5.2",
    "next": "^13.4.0",
    "ui": "*"
  },
  "devDependencies": {
    "@types/node": "18.16.0",
    "@types/react": "18.2.0",
    "@types/react-dom": "18.2.0",
    "eslint": "8.39.0",
    "eslint-config-custom": "*",
    "prismic-ts-codegen": "^0.1.7",
    "react": "^18.2.0",
    "react-dom": "^18.2.0",
    "tsconfig": "*",
    "typescript": "5.0.4"
  }
}

Has this anything to do with the newest version or the update to @prismicio/client v7?

Thank you for your support.

@andre-lergier andre-lergier added the bug Something isn't working label May 18, 2023
@andre-lergier
Copy link
Author

I just saw your new 0.1.8 release. 🙂
The error still appears in my repository...

"prismic-ts-codegen": "^0.1.8"

@angeloashmore
Copy link
Member

angeloashmore commented May 19, 2023

Hey @andre-lergier, sorry for the trouble!

Could you try the latest release, v0.1.9?

We don't have proper tests for the CLI yet, which unfortunately resulted in some faulty releases.


For context, yes, this is related to the updates required for @prismicio/client v7.

If you are on @prismicio/client v7 and the latest version of prismic-ts-codegen, you should be able to use types from @prismicio/client instead of @prismicio/types.

@andre-lergier
Copy link
Author

Hi @angeloashmore

Thank you for the quick release - you saved my day!
Now it works again...

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants