I build fullstack application using Node.js + Typescript and React+ Typescript. Folder structure:
App
-node_modules //server part's dependencies
-build //includes compiled server code
-src
-server
-client
-node_modules //client part's dependencies
tsconfig.json //created by 'create-react-app'
package.json //created by 'create-react-app'
tsconfig.json
tslint.json
package.json // includes config for server compiling and running
So, when I execute command tsc && node build/www
server starts.
But if I want to build react bundle with command react-scripts-ts start
, I get errors that do not belong to the react project. For example:
Failed to compile.
~/projects/App/node_modules/@types/graphql/execution/execute.d.ts
(1,44): Cannot find module '../error'.
Why does react-scripts-ts look for dependencies in non-react folder?