thecodingmachine / react-native-boilerplate

A React Native template for building solid applications 🐙, using JavaScript 💛 or Typescript 💙 (you choose).
https://thecodingmachine.github.io/react-native-boilerplate/
MIT License
4.82k stars 868 forks source link

[BUG]: Post init script Error starting new project #372

Closed digimatt22 closed 1 year ago

digimatt22 commented 1 year ago

react-native environment setup

Description

After running npx react-native@latest init MyApp --template @thecodingmachine/react-native-boilerplate the following error is reported:

🧱 Building the javascript source... node:internal/errors:867 const err = new Error(message); ^

Error: Command failed: npx tsc --jsx react-native --module ESNext -t esnext --outDir js --noEmit false at checkExecSyncError (node:child_process:885:11) at execSync (node:child_process:957:15) at /private/var/folders/ld/hrw7ryqs1gx_tg51d0l83r400000gn/T/rncli-init-template-S7Y4r1/node_modules/@thecodingmachine/react-native-boilerplate/template/plugins/compile-js/plugin.js:13:15 at process.processTicksAndRejections (node:internal/process/task_queues:95:5)

Version

Latest

On which OS this issue appear on?

Desktop OS

OSX Ventura 13.4.1 (c)

grantspilsbury commented 1 year ago

I get the same error

Jarvie789 commented 1 year ago

same error

JeremyDolle commented 1 year ago

Can you try running npx tsc --jsx react-native --module ESNext -t esnext --outDir js --noEmit false out of the script and give me the results. Please also provide me the node, npm and yarn version of your device.

digimatt22 commented 1 year ago

Running the above command inside a project using TypeScript (which works successfully) results in no output. Running the command in the project using Javascript (which fails) results in the following error:

error TS2688: Cannot find type definition file for 'react-native'. The file is in the program because: Entry point of type library 'react-native' specified in compilerOptions

tsconfig.json:4:15 4 "types": ["react-native", "jest", "node"],


    File is entry point of type library specified here.

Followed by a number of Cannot write file because it would overwrite the input file.

Node Version 19.9.0
NPM Version 9.6.3
Yarn Version 1.22.19