Heroku deployment error
See original GitHub issueEn essayant de déployer mon fork sur heroku, j’ai eu cette erreur:
👷 parcel-plugin-sw-cache: sw-cache: Service worker generation failed Error: There was an issue using one of the provided 'templatedURLs'. 'index.html' from '{"./":["index.html"]}':
Error: One of the glob patterns doesn't match any files. Please remove or fix the following: {
"globDirectory": "/tmp/build_8e305657_/dist",
"globPattern": "index.html",
"globIgnores": [
"**/node_modules/**/*",
"**/sw.js"
]
}
at /tmp/build_8e305657_/node_modules/workbox-build/build/lib/get-file-manifest-entries.js:104:21
at Array.reduce (<anonymous>)
at /tmp/build_8e305657_/node_modules/workbox-build/build/lib/get-file-manifest-entries.js:91:40
at Generator.next (<anonymous>)
at asyncGeneratorStep (/tmp/build_8e305657_/node_modules/@babel/runtime/helpers/asyncToGenerator.js:3:24)
at _next (/tmp/build_8e305657_/node_modules/@babel/runtime/helpers/asyncToGenerator.js:25:9)
at /tmp/build_8e305657_/node_modules/@babel/runtime/helpers/asyncToGenerator.js:32:7
at new Promise (<anonymous>)
at /tmp/build_8e305657_/node_modules/@babel/runtime/helpers/asyncToGenerator.js:21:12
at /tmp/build_8e305657_/node_modules/workbox-build/build/lib/get-file-manifest-entries.js:130:17
Suivie d’autres. Une idée de comment je pourrais régler le problème ? Voici le log complet.
-----> Node.js app detected
-----> Creating runtime environment
NPM_CONFIG_LOGLEVEL=error
NODE_ENV=production
NODE_MODULES_CACHE=true
NODE_VERBOSE=false
-----> Installing binaries
engines.node (package.json): unspecified
engines.npm (package.json): unspecified (use default)
Resolving node version 12.x...
Downloading and installing node 12.19.0...
Using default npm version: 6.14.8
-----> Installing dependencies
Installing node modules
> @fortawesome/fontawesome-common-types@0.2.32 postinstall /tmp/build_8e305657_/node_modules/@fortawesome/fontawesome-common-types
> node attribution.js
Font Awesome Free 0.2.32 by @fontawesome - https://fontawesome.com
License - https://fontawesome.com/license/free (Icons: CC BY 4.0, Fonts: SIL OFL 1.1, Code: MIT License)
> @fortawesome/free-solid-svg-icons@5.15.1 postinstall /tmp/build_8e305657_/node_modules/@fortawesome/free-solid-svg-icons
> node attribution.js
Font Awesome Free 5.15.1 by @fontawesome - https://fontawesome.com
License - https://fontawesome.com/license/free (Icons: CC BY 4.0, Fonts: SIL OFL 1.1, Code: MIT License)
> @fortawesome/fontawesome-svg-core@1.2.32 postinstall /tmp/build_8e305657_/node_modules/@fortawesome/fontawesome-svg-core
> node attribution.js
Font Awesome Free 1.2.32 by @fontawesome - https://fontawesome.com
License - https://fontawesome.com/license/free (Icons: CC BY 4.0, Fonts: SIL OFL 1.1, Code: MIT License)
> puppeteer@1.20.0 install /tmp/build_8e305657_/node_modules/puppeteer
> node install.js
> core-js@2.6.11 postinstall /tmp/build_8e305657_/node_modules/core-js
> node -e "try{require('./postinstall')}catch(e){}"
> deasync@0.1.20 install /tmp/build_8e305657_/node_modules/deasync
> node ./build.js
`linux-x64-node-12` exists; testing
Binary is fine; exiting
> fsevents@1.2.13 install /tmp/build_8e305657_/node_modules/@parcel/watcher/node_modules/fsevents
> node install.js
Skipping 'fsevents' build as platform linux is not supported
> parcel-bundler@1.12.4 postinstall /tmp/build_8e305657_/node_modules/parcel-bundler
> node -e "console.log('\u001b[35m\u001b[1mLove Parcel? You can now donate to our open collective:\u001b[22m\u001b[39m\n > \u001b[34mhttps://opencollective.com/parcel/donate\u001b[0m')"
Love Parcel? You can now donate to our open collective:
> https://opencollective.com/parcel/donate
added 1251 packages in 27.66s
-----> Build
Running build
> attestation-derogatoire-de-deplacement@1.0.5 prebuild /tmp/build_8e305657_
> run-p lint clean:dist
> attestation-derogatoire-de-deplacement@1.0.5 lint /tmp/build_8e305657_
> eslint src/**/*.js
> attestation-derogatoire-de-deplacement@1.0.5 clean:dist /tmp/build_8e305657_
> rimraf dist
> attestation-derogatoire-de-deplacement@1.0.5 build /tmp/build_8e305657_
> cross-env npm run build:simple
> attestation-derogatoire-de-deplacement@1.0.5 build:simple /tmp/build_8e305657_
> cross-env-shell VERSION=$npm_package_version parcel build --public-url $PUBLIC_URL ./src/index.html ./src/robots.txt ./src/sitemap.xml
lscpu: failed to determine number of CPUs: /sys/devices/system/cpu/possible: No such file or directory
✨ Built in 1.01s.
dist/sitemap.xml 886 B 770ms
dist/robots.txt 74 B 770ms
👷 parcel-plugin-sw-cache: sw-cache: Service worker generation failed Error: There was an issue using one of the provided 'templatedURLs'. 'index.html' from '{"./":["index.html"]}':
Error: One of the glob patterns doesn't match any files. Please remove or fix the following: {
"globDirectory": "/tmp/build_8e305657_/dist",
"globPattern": "index.html",
"globIgnores": [
"**/node_modules/**/*",
"**/sw.js"
]
}
at /tmp/build_8e305657_/node_modules/workbox-build/build/lib/get-file-manifest-entries.js:104:21
at Array.reduce (<anonymous>)
at /tmp/build_8e305657_/node_modules/workbox-build/build/lib/get-file-manifest-entries.js:91:40
at Generator.next (<anonymous>)
at asyncGeneratorStep (/tmp/build_8e305657_/node_modules/@babel/runtime/helpers/asyncToGenerator.js:3:24)
at _next (/tmp/build_8e305657_/node_modules/@babel/runtime/helpers/asyncToGenerator.js:25:9)
at /tmp/build_8e305657_/node_modules/@babel/runtime/helpers/asyncToGenerator.js:32:7
at new Promise (<anonymous>)
at /tmp/build_8e305657_/node_modules/@babel/runtime/helpers/asyncToGenerator.js:21:12
at /tmp/build_8e305657_/node_modules/workbox-build/build/lib/get-file-manifest-entries.js:130:17
> attestation-derogatoire-de-deplacement@1.0.5 postbuild /tmp/build_8e305657_
> cross-env-shell react-snap
events.js:291
throw er; // Unhandled 'error' event
^
Error: ENOENT: no such file or directory, open '/tmp/build_8e305657_/dist/index.html'
Emitted 'error' event on ReadStream instance at:
at internal/fs/streams.js:136:12
at FSReqCallback.oncomplete (fs.js:156:23) {
errno: -2,
code: 'ENOENT',
syscall: 'open',
path: '/tmp/build_8e305657_/dist/index.html'
}
npm ERR! code ELIFECYCLE
npm ERR! errno 1
npm ERR! attestation-derogatoire-de-deplacement@1.0.5 postbuild: `cross-env-shell react-snap`
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the attestation-derogatoire-de-deplacement@1.0.5 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.ZnZp5/_logs/2020-11-01T14_34_58_325Z-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
Issue Analytics
- State:
- Created 3 years ago
- Comments:16
Top Results From Across the Web
Why am I seeing "Application Error"? - Heroku Help
"Application Error" or similar is always caused by your own application code. Routing errors will normally only surface themselves within the logs of...
Read more >3 tricks for solving the `Heroku Application Error` - Medium
Click the `allow access from anywhere` button and then `confirm` ; Crazy tips: · start your project on another folder/directory on your computer ......
Read more >Heroku: Most Common Errors Explained - Papertrail
You can resolve the first error (package load fails) by adding a forceful install through a tools.go package to your app. Alternatively, you...
Read more >Heroku app successfully deploying, but receiving application ...
Welcome to Stack Overflow. HTTP 500 ("application error") is a generic server-side error message. On its own it doesn't tell us anything useful....
Read more >7. When It Goes Wrong - Heroku: Up and Running [Book]
Runtime Error Detection and Debugging · Deploy Visibility · Test Visibility · Performance Visibility · Exception Visibility · Logging Add-Ons · Exception Notification....
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
J’ai pris ton package.json ainsi que ton Procfile, j’ai déplacé tout les devDependencies dans les Dependencies car elles sont purgées après chaque build et devant chaque commandes parcel j’ai ajouté l’argument npx afin de pouvoir charger les modules depuis un dossier externe je crois. Je débute sur Node.js, j’ai utilisé la documentation mais tout à l’air de fonctionner.
Pour que ce soit plus propre, il faudrait ne pas toucher aux devDependencies et aux Dependencies mais changer la config d’Heroku telle que :
NPM_CONFIG_PRODUCTION=false
, comme ça les packages Dev ne sont pas supprimés après chaque build.M’enfin voilà ça fonctionne, si je peux vous être utile n’hésitez pas 😃
Problème résolu de mon côté. Tout fonctionne sur Heroku, merci à tous. Je push tout ça et je vous envoie le repo.
EDIT : Repo Heroku Friendly