question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

"chakra-cli tokens" command fails

See original GitHub issue

Description

Trying to run the chakra-cli tokens command fails with error: TypeError: Cannot read properties of undefined (reading 'message').

Link to Reproduction

https://github.com/kculmback/chakra-bug

Steps to reproduce

  1. Download reproduction repo
  2. Run npm install
  3. Run npm run gen:theme-typings
  4. See error:
TypeError: Cannot read properties of undefined (reading 'message')
    at yx (node_modules/prettier/parser-typescript.js:13:3304348)
    at Object.parse (node_modules/prettier/parser-typescript.js:13:3304817)
    at Object.parse$d [as parse] (node_modules/prettier/index.js:12975:19)
    at coreFormat (node_modules/prettier/index.js:14525:16)
    at formatWithCursor$1 (node_modules/prettier/index.js:14765:14)
    at node_modules/prettier/index.js:60959:14
    at Object.format (node_modules/prettier/index.js:60979:12)
    at node_modules/@chakra-ui/cli/src/utils/format-with-prettier.ts:8:19
    at async run (node_modules/@chakra-ui/cli/src/scripts/read-theme-file.worker.ts:113:20)

Chakra UI Version

1.7.3

Browser

No response

Operating System

  • macOS
  • Windows
  • Linux

Additional Information

Chakra v1.7.3 Chakra CLI v1.6.0 Node v16.13.1

Repo was made using Vite; used npm init vite@latest and selected react-ts. Added Chakra and Chakra CLI, theme file, and command to generate theme typings.

Issue Analytics

  • State:closed
  • Created 2 years ago
  • Reactions:3
  • Comments:32 (12 by maintainers)

github_iconTop GitHub Comments

4reactions
TimKolbergercommented, Dec 26, 2021

I pushed a fix for this which works on my machine (yay) with this project: https://github.com/kculmback/chakra-bug

You can try this version by installing this version of @chakra-ui/cli in your package.json:

"@chakra-ui/cli": "0.0.0-pr-20211126153854",

Let me know if there are still issues in your project.

3reactions
lucasfranchinicommented, Apr 5, 2022

I downgraded the prettier and it works thank you @OnielN14!

Read more comments on GitHub >

github_iconTop Results From Across the Web

CLI - Chakra UI
The Chakra UI CLI can be used to generate typings for your custom theme tokens, like colors, semantic tokens, component variants, etc. The...
Read more >
@chakra-ui/cli - npm
Start using @chakra-ui/cli in your project by running `npm i @chakra-ui/cli`. There are 7 other projects in the npm registry using ...
Read more >
@blocto/blocto-chakra-theme - NPM Package Overview - Socket
Start using Socket to analyze @blocto/blocto-chakra-theme and its 0 dependencies to secure ... yarn add @chakra-ui/styled-system npx @chakra-ui/cli tokens ...
Read more >
Making a front-end for your Solana dApp with Chakra UI
Create beautiful front-ends for Solana dApps using the Chakra UI library ... minting tokens or NFTs - however a decentralized app is incomplete...
Read more >
Command Line Interface | RedwoodJS Docs
Compares the list of files in api/db/dataMigrations to the records in the DataMigration table in the database and executes any files not present....
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found