bradtraversy / mern_shopping_list

Shopping List built with MERN and Redux
605 stars 436 forks source link

Errors when running project #60

Open bitgainz opened 3 years ago

bitgainz commented 3 years ago

Local test - when submitting credentials Proxy error: Could not proxy request /api/items from localhost:3000 to http://localhost:5000/. [1] See https://nodejs.org/api/errors.html#errors_common_system_errors for more information (ECONNREFUSED).

When deploying to heroku - error log :

-----> Building on the Heroku-20 stack -----> Node.js app detected

-----> Creating runtime environment

   NPM_CONFIG_LOGLEVEL=error
   NODE_VERBOSE=false
   NODE_ENV=production
   NODE_MODULES_CACHE=true

-----> Installing binaries engines.node (package.json): unspecified engines.npm (package.json): unspecified (use default)

   Resolving node version 12.x...
   Downloading and installing node 12.20.1...
   Using default npm version: 6.14.10

-----> Installing dependencies Installing node modules (package.json)

   > core-js@2.6.12 postinstall /tmp/build_e7159bee/node_modules/core-js
   > node -e "try{require('./postinstall')}catch(e){}"

   > nodemon@1.19.4 postinstall /tmp/build_e7159bee/node_modules/nodemon
   > node bin/postinstall || exit 0

   Love nodemon? You can now support the project via the open collective:
    > https://opencollective.com/nodemon/donate

   added 529 packages from 324 contributors and audited 531 packages in 19.175s

   7 packages are looking for funding
     run `npm fund` for details

   found 1 low severity vulnerability
     run `npm audit fix` to fix them, or `npm audit` for details

-----> Build Running heroku-postbuild

   > mern_typescript@1.0.0 heroku-postbuild /tmp/build_e7159bee
   > NPM_CONFIG_PRODUCTION=false npm install --prefix client && npm run build --prefix client

   > core-js@2.6.12 postinstall /tmp/build_e7159bee/client/node_modules/babel-runtime/node_modules/core-js
   > node -e "try{require('./postinstall')}catch(e){}"

   > core-js@3.8.3 postinstall /tmp/build_e7159bee/client/node_modules/core-js
   > node -e "try{require('./postinstall')}catch(e){}"

   > core-js-pure@3.8.3 postinstall /tmp/build_e7159bee/client/node_modules/core-js-pure
   > node -e "try{require('./postinstall')}catch(e){}"

   added 1690 packages from 1077 contributors and audited 1703 packages in 62.777s

   78 packages are looking for funding
     run `npm fund` for details

   found 5 vulnerabilities (1 low, 4 high)
     run `npm audit fix` to fix them, or `npm audit` for details

   > client-ts@0.1.0 build /tmp/build_e7159bee/client
   > react-scripts build

   Creating an optimized production build...
   Failed to compile.

   /tmp/build_e7159bee/client/src/App.tsx
   TypeScript error in /tmp/build_e7159bee/client/src/App.tsx(1,34):
   Could not find a declaration file for module 'react'. '/tmp/build_e7159bee/client/node_modules/react/index.js' implicitly has an 'any' type.
     If the 'react' package actually exposes this module, consider sending a pull request to amend 'https://github.com/DefinitelyTyped/DefinitelyTyped/tree/master/types/react`  TS7016

     > 1 | import React, { useEffect } from 'react';
         |                                  ^
       2 | import AppNavbar from './components/AppNavbar';
       3 | import ShoppingList from './components/ShoppingList';
       4 | import ItemModal from './components/ItemModal';

npm ERR! code ELIFECYCLE npm ERR! errno 1 npm ERR! client-ts@0.1.0 build: react-scripts build npm ERR! Exit status 1 npm ERR! npm ERR! Failed at the client-ts@0.1.0 build script. npm ERR! This is probably not a problem with npm. There is likely additional logging output above. npm ERR! A complete log of this run can be found in: npm ERR! /tmp/npmcache.o5qtJ/_logs/2021-01-22T22_42_26_188Z-debug.log npm ERR! code ELIFECYCLE npm ERR! errno 1 npm ERR! mern_typescript@1.0.0 heroku-postbuild: NPM_CONFIG_PRODUCTION=false npm install --prefix client && npm run build --prefix client npm ERR! Exit status 1 npm ERR! npm ERR! Failed at the mern_typescript@1.0.0 heroku-postbuild script. npm ERR! This is probably not a problem with npm. There is likely additional logging output above. npm ERR! A complete log of this run can be found in: npm ERR! /tmp/npmcache.o5qtJ/_logs/2021-01-22T22_42_26_216Z-debug.log -----> Build failed

   We're sorry this build is failing! You can troubleshoot common issues here:
   https://devcenter.heroku.com/articles/troubleshooting-node-deploys

   Some possible problems:

   - Node version not specified in package.json
     https://devcenter.heroku.com/articles/nodejs-support#specifying-a-node-js-version

   Love,
   Heroku

! Push rejected, failed to compile Node.js app. ! Push failed

sayinmehmet47 commented 3 years ago
{

  "proxy": "http://127.0.0.1:5000"
}

use that instead localhost:5000