0

I am trying to deploy a parcel react app, with no backend on Heroku. The build keeps failing, I have tried everything on the internet. Here is the script & dependencies. Here is the error.

Error:

    lscpu: failed to determine number of CPUs: /sys/devices/system/cpu/possible: No such file or directory

/tmp/build_c7ac30db/src/components/App.js:14:19: Cannot resolve dependency '../pages/a00auth/A01SignUp.js' at '/tmp/build_c7ac30db/src/pages/a00auth/A01SignUp.js'
         12 |
         13 | import errorReporting from '../exceptions/errorReporting';
       > 14 | import SignUp from '../pages/a00auth/A01SignUp.js';
            |                   ^
         15 | import SignIn from '../pages/a00auth/A02SignIn';
         16 | import OfflineMessage from '../components/OfflineMessage';
         17 |
npm ERR! code ELIFECYCLE
npm ERR! errno 1
npm ERR! teziagents@1.0.0 heroku-postbuild: `parcel build ./src/index.html`
npm ERR! Exit status 1
npm ERR! 
npm ERR! Failed at the teziagents@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.05UZK/_logs/2021-09-23T09_57_29_536Z-debug.log
-----> Build failed

Scripts:

"scripts": {
    "start": "parcel ./src/index.html",
    "build": "parcel build ./src/index.html",
    "postbuild": "workbox generateSW",
    "predeploy": "rm -rf dist && npm run build",
    "deploy": "gh-pages -d dist"
  },

Dependencies:

"dependencies": {
    "@reach/router": "^1.3.4",
    "grommet": "^2.17.1",
    "grommet-controls": "^3.0.1",
    "grommet-icons": "^4.5.0",
    "parcel-bundler": "^1.12.5",
    "@parcel/transformer-webmanifest": "^2.0.0-beta.2",
    "pouchdb": "^7.2.2",
    "pouchdb-authentication": "^1.1.3",
    "pouchdb-browser": "^7.2.2",
    "pouchdb-core": "^7.2.2",
    "pouchdb-find": "^7.2.2",
    "react": "^17.0.2",
    "react-dom": "^17.0.2",
    "react-hook-form": "^7.7.1",
    "styled-components": "^5.2.3",
    "tslib": "^2.2.0"
  },

Any help here is greatly appreciated. Have been breaking my head against this for a month now

Krishna
  • 55
  • 1
  • 1
  • 5

1 Answers1

0

Heroku is made for backend applications. It's not able to build your application.

So, if you want to develop your react application there has to be using a nodejs wrapper (of the built application) which is more complicated but also doesn't work as fast as it can.

In this case, if you want to deploy a fast react application with almost no configuration you can use:

Or if you can build at your end and just upload the dist folder, you can also use:

joseglego
  • 2,011
  • 1
  • 17
  • 28
  • Thanks for the reply. I am getting the following error on netlify. The same error was also on heroku. The folder is there its building on my local machine. What am I missing? ``` /opt/build/repo/src/components/App.js:14:19: Cannot resolve dependency '../pages/a00auth/A01SignUp.js' at '/opt/build/repo/src/pages/a00auth/A01SignUp.js' ``` – Krishna Sep 23 '21 at 11:05
  • Is workbox-cli in your dev-dependencies? – joseglego Sep 23 '21 at 11:11
  • No it's not in any dependencies. – Krishna Sep 23 '21 at 12:04