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.

CRA with NPM/TypeScript failing

See original GitHub issue

Description

When I run the “TypeScript using npm” command found here I am getting errors in my terminal and the command exits before completing.

Link to Reproduction

This happens in the terminal

Steps to reproduce

Run this command:

npx create-react-app ch_npm --template @chakra-ui/typescript

Error: image

Chakra UI Version

Latest stable

Browser

No response

Operating System

  • macOS
  • Windows
  • Linux

Additional Information

I’m using WSL2 Node v14.19.1 NPM 6.14.16

Issue Analytics

  • State:closed
  • Created a year ago
  • Reactions:8
  • Comments:12 (1 by maintainers)

github_iconTop GitHub Comments

7reactions
ggrantrowberrycommented, Apr 1, 2022

I’m also having an issue with this. I don’t get the same error however.

I ran yarn create react-app my-app --template @chakra-ui/typescript It installed properly it seems but then when I start it nothing appears in the browser. The following error showed up in the console.

bootstrap:27 Uncaught TypeError: framer_motion__WEBPACK_IMPORTED_MODULE_5__.motion.custom is not a function
    at Module../node_modules/@chakra-ui/checkbox/dist/chakra-ui-checkbox.esm.js (chakra-ui-checkbox.esm.js:146:1)
    at Module.options.factory (react refresh:6:1)
    at __webpack_require__ (bootstrap:24:1)
    at fn (hot module replacement:62:1)
    at Module../node_modules/@chakra-ui/react/dist/chakra-ui-react.esm.js (chakra-ui-react-utils.esm.js:91:1)
    at Module.options.factory (react refresh:6:1)
    at __webpack_require__ (bootstrap:24:1)
    at fn (hot module replacement:62:1)
    at Module../src/App.tsx (logo.svg:47:1)
    at Module.options.factory (react refresh:6:1)

I am using MacOS. With Node v16.13.2 and npm v8.1.2

4reactions
ggrantrowberrycommented, Apr 1, 2022

Same error occurs if Chakra is installed manually. Here are my dependencies.

"@chakra-ui/react": "^1.8.7",
"@emotion/react": "^11",
"@emotion/styled": "^11",
"@testing-library/jest-dom": "^5.14.1",
"@testing-library/react": "^12.0.0",
"@testing-library/user-event": "^13.2.1",
"@types/jest": "^27.0.1",
"@types/node": "^16.7.13",
"@types/react": "^17.0.20",
"@types/react-dom": "^17.0.9",
"framer-motion": "^6",
"react": "^18.0.0",
"react-dom": "^18.0.0",
"react-scripts": "5.0.0",
"typescript": "^4.4.2",
"web-vitals": "^2.1.0"

It’s probably worth noting that react is version 18.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Create-React-App with TypeScript failing to compile after ...
I solved the problem this way : Install css-patch with this command : npm install --dev @semantic-ui-react/css-patch.
Read more >
cra-template-typescript - npm
The base TypeScript template for Create React App.. ... Start using cra-template-typescript in your project by running `npm i ...
Read more >
Using TypeScript - React Native
If you're starting a new project, there are a few different ways to get started. ... If the above command is failing, you...
Read more >
Create React App and TypeScript: A Quick How-To | Built In
If you're still getting an error in your tsconfig.js file, you might be using different versions of TypeScript. Type cmd + shift ...
Read more >
Using React with TypeScript - Mattermost
This usually occurs because tsconfig.json (TypeScript's configuration file) is absent from your project. CRA should generate this for you, but ...
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