i tried to push my angular app to heroku, followed some steps on internet that told me to change the package.json and make a server.js. But in the end i got the message saying "Not found"
when i tried to see the webpage through the link https://silenxika.herokuapp.com/ thus seeking for help now
Below is the build log
-----> Building on the Heroku-20 stack
-----> Using buildpack: heroku/nodejs
-----> 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): 16.13.2
engines.npm (package.json): 8.1.2
Resolving node version 16.13.2...
Downloading and installing node 16.13.2...
npm 8.1.2 already installed with node
-----> Restoring cache
- node_modules
-----> Installing dependencies
Installing node modules
added 1016 packages, and audited 1017 packages in 28s
91 packages are looking for funding
run `npm fund` for details
41 vulnerabilities (3 low, 38 moderate)
To address all issues, run:
npm audit fix
Run `npm audit` for details.
-----> Build
Detected both "build" and "heroku-postbuild" scripts
Running heroku-postbuild
> silenxika#0.0.0 heroku-postbuild
> ng build --prod
Option "--prod" is deprecated: No need to use this option as this builder defaults to configuration "production".
- Generating browser application bundles (phase: setup)...
✔ Browser application bundle generation complete.
✔ Browser application bundle generation complete.
- Copying assets...
✔ Copying assets complete.
- Generating index html...
✔ Index html generation complete.
Initial Chunk Files | Names | Raw Size | Estimated Transfer Size
./src/styles.css.webpack[javascript/auto]!=!./node_modules/css-loader/dist/cjs.js??ruleSet[1].rules[4].rules[0].oneOf[0].use[1]!./node_modules/postcss-loader/dist/cjs.js??ruleSet[1].rules[4].rules[0].oneOf[0].use[2]!./src/styles.css - Warning: Module Warning (from ./node_modules/postcss-loader/dist/cjs.js):
Warning
(8:1) postcss-import: #import must precede all other statements (besides #charset)
Warning: /tmp/build_fe342bb2/src/app/main/navbar/navbar.component.css exceeded maximum budget. Budget 2.00 kB was not met by 381 bytes with a total of 2.37 kB.
Warning: /tmp/build_fe342bb2/src/app/pr/productblocks/productblocks.component.css exceeded maximum budget. Budget 2.00 kB was not met by 468 bytes with a total of 2.46 kB.
Warning: /tmp/build_fe342bb2/src/app/pr/productdiscordbot/productdiscordbot.component.css exceeded maximum budget. Budget 2.00 kB was not met by 478 bytes with a total of 2.47 kB.
Warning: /tmp/build_fe342bb2/src/app/pr/productpython/productpython.component.css exceeded maximum budget. Budget 2.00 kB was not met by 490 bytes with a total of 2.48 kB.
Warning: /tmp/build_fe342bb2/src/app/pr/productwebapps/productwebapps.component.css exceeded maximum budget. Budget 2.00 kB was not met by 477 bytes with a total of 2.47 kB.
main.5712c2806cc4359c.js | main | 215.14 kB | 53.95 kB
polyfills.25274fd5295a26dd.js | polyfills | 36.22 kB | 11.51 kB
runtime.65e870f2d783c48d.js | runtime | 1.05 kB | 602 bytes
styles.9a90c74daf5db7df.css | styles | 550 bytes | 227 bytes
| Initial Total | 252.94 kB | 66.27 kB
Build at: 2022-01-24T08:56:09.827Z - Hash: c130164e2fe9624a - Time: 20079ms
-----> Caching build
- node_modules
-----> Pruning devDependencies
removed 1 package, and audited 74 packages in 4s
2 packages are looking for funding
run `npm fund` for details
found 0 vulnerabilities
-----> Build succeeded!
-----> Discovering process types
Procfile declares types -> (none)
Default types for buildpack -> web
-----> Compressing...
Done: 49.6M
-----> Launching...
Released v5
https://silenxika.herokuapp.com/ deployed to Heroku
Related
I am trying to deploy my reactjs app to heroku. The deployment is successful, but whenever I open up the application, it just displays Application Error.
I have already added https://github.com/mars/create-react-app-buildpack into the buildpack in heroku settings and created a procfile with web: bin/boot inside of it.
This is the build log:
-----> Building on the Heroku-20 stack
-----> Using buildpacks:
1. heroku/nodejs
2. https://github.com/mars/create-react-app-buildpack
-----> 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 16.x...
Downloading and installing node 16.15.0...
Using default npm version: 8.5.5
-----> Restoring cache
Cached directories were not restored due to a change in version of node, npm, yarn or stack
Module installation may take longer for this build
-----> Installing dependencies
Installing node modules
added 1927 packages, and audited 1928 packages in 40s
80 packages are looking for funding
run `npm fund` for details
68 vulnerabilities (14 low, 17 moderate, 32 high, 5 critical)
To address issues that do not require attention, run:
npm audit fix
To address all issues (including breaking changes), run:
npm audit fix --force
Run `npm audit` for details.
-----> Build
Running build
> geoffhui.github.io#0.1.0 build
> react-scripts build
Creating an optimized production build...
Compiled with warnings.
./src/functions/data.js
Line 1: Multiline support is limited to browsers supporting ES5 only no-multi-str
./src/App.js
Line 20: Expected a default case default-case
Line 28: Expected a default case default-case
Line 78: Using target="_blank" without rel="noopener noreferrer" is a security risk: see https://mathiasbynens.github.io/rel-noopener react/jsx-no-target-blank
Line 85: Using target="_blank" without rel="noopener noreferrer" is a security risk: see https://mathiasbynens.github.io/rel-noopener react/jsx-no-target-blank
./src/components/FolderDataContainer.js
Line 34: Using target="_blank" without rel="noopener noreferrer" is a security risk: see https://mathiasbynens.github.io/rel-noopener react/jsx-no-target-blank
Search for the keywords to learn more about each warning.
To ignore, add // eslint-disable-next-line to the line before.
File sizes after gzip:
48.24 KB build/static/js/1.0df6a7a0.chunk.js
2.33 KB build/static/js/main.b4134d42.chunk.js
1.32 KB build/static/css/main.618b06ac.chunk.css
763 B build/static/js/runtime~main.229c360f.js
The project was built assuming it is hosted at the server root.
You can control this with the homepage field in your package.json.
For example, add this to build it for GitHub Pages:
"homepage" : "http://myname.github.io/myapp",
The build folder is ready to be deployed.
You may serve it with a static server:
npm install -g serve
serve -s build
Find out more about deployment here:
-----> Caching build
- node_modules
-----> Pruning devDependencies
up to date, audited 1912 packages in 4s
77 packages are looking for funding
run `npm fund` for details
68 vulnerabilities (14 low, 17 moderate, 32 high, 5 critical)
To address issues that do not require attention, run:
npm audit fix
To address all issues (including breaking changes), run:
npm audit fix --force
Run `npm audit` for details.
-----> Build succeeded!
-----> React.js (create-react-app) multi app detected
=====> Downloading Buildpack: https://github.com/heroku/heroku-buildpack-multi.git
=====> Detected Framework: Multipack
=====> Downloading Buildpack: https://github.com/heroku/heroku-buildpack-nodejs.git
=====> Detected Framework: Node.js
-----> Creating runtime environment
NPM_CONFIG_LOGLEVEL=error
NODE_VERBOSE=false
NODE_ENV=production
NODE_HOME=/tmp/build_cefa3715/.heroku/node
NODE_MODULES_CACHE=true
-----> Installing binaries
engines.node (package.json): unspecified
engines.npm (package.json): unspecified (use default)
Resolving node version 16.x...
Downloading and installing node 16.15.0...
Using default npm version: 8.5.5
-----> Restoring cache
Cached directories were not restored due to a change in version of node, npm, yarn or stack
Module installation may take longer for this build
-----> Installing dependencies
Prebuild detected (node_modules already exists)
Rebuilding any native modules
rebuilt dependencies successfully
Installing any new modules (package.json)
added 16 packages, and audited 1928 packages in 7s
80 packages are looking for funding
run `npm fund` for details
68 vulnerabilities (14 low, 17 moderate, 32 high, 5 critical)
To address issues that do not require attention, run:
npm audit fix
To address all issues (including breaking changes), run:
npm audit fix --force
Run `npm audit` for details.
-----> Build
Running build
> geoffhui.github.io#0.1.0 build
> react-scripts build
Creating an optimized production build...
Compiled with warnings.
./src/functions/data.js
Line 1: Multiline support is limited to browsers supporting ES5 only no-multi-str
./src/App.js
Line 20: Expected a default case default-case
Line 28: Expected a default case default-case
Line 78: Using target="_blank" without rel="noopener noreferrer" is a security risk: see https://mathiasbynens.github.io/rel-noopener react/jsx-no-target-blank
Line 85: Using target="_blank" without rel="noopener noreferrer" is a security risk: see https://mathiasbynens.github.io/rel-noopener react/jsx-no-target-blank
./src/components/FolderDataContainer.js
Line 34: Using target="_blank" without rel="noopener noreferrer" is a security risk: see https://mathiasbynens.github.io/rel-noopener react/jsx-no-target-blank
Search for the keywords to learn more about each warning.
To ignore, add // eslint-disable-next-line to the line before.
File sizes after gzip:
48.24 KB build/static/js/1.0df6a7a0.chunk.js
2.33 KB build/static/js/main.b4134d42.chunk.js
1.32 KB build/static/css/main.618b06ac.chunk.css
763 B build/static/js/runtime~main.229c360f.js
The project was built assuming it is hosted at the server root.
You can control this with the homepage field in your package.json.
For example, add this to build it for GitHub Pages:
"homepage" : "http://myname.github.io/myapp",
The build folder is ready to be deployed.
You may serve it with a static server:
npm install -g serve
serve -s build
Find out more about deployment here:
-----> Caching build
- node_modules
-----> Pruning devDependencies
up to date, audited 1912 packages in 4s
77 packages are looking for funding
run `npm fund` for details
68 vulnerabilities (14 low, 17 moderate, 32 high, 5 critical)
To address issues that do not require attention, run:
npm audit fix
To address all issues (including breaking changes), run:
npm audit fix --force
Run `npm audit` for details.
-----> Build succeeded!
=====> Downloading Buildpack: https://github.com/mars/create-react-app-inner-buildpack.git#v9.0.0
=====> Detected Framework: React.js (create-react-app)
Writing `static.json` to support create-react-app
Enabling runtime environment variables
=====> Downloading Buildpack: https://github.com/heroku/heroku-buildpack-static.git
=====> Detected Framework: Static HTML
-----> Installed nginx 1.21.3 to /app/bin
Using release configuration from last framework (Static HTML).
-----> Discovering process types
~ Mis-cased procfile detected; ignoring.
~ Rename it to Procfile to have it honored.
Procfile declares types -> (none)
Default types for buildpack -> web
-----> Compressing...
Done: 113.5M
-----> Launching...
Released v13
https://geoff-portfolio.herokuapp.com/ deployed to Heroku
Any ideas?
I've seen you are using two build packs
-----> Using buildpacks:
1. heroku/nodejs
2. https://github.com/mars/create-react-app-buildpack
Could you try to remove heroku/nodejs and keep only create-react-app-buildpack?
Steps : App -> Settings -> buildpacks
settings
First of all, hello everyone. I created a bot for Telegram that I wrote with node.js. When I want to deploy it on Heroku, it continues to deploy for a very long time (Approximately 20mins and failure). When I want to try the bot on telegram it works fine. But I still see "Pending" text instead of "Success" in the Github Environments section. What can I do? The logs are like this:
-----> Building on the Heroku-20 stack
-----> Determining which buildpack to use for this app
-----> 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): 16.14
engines.npm (package.json): 8.5
Resolving node version 16.14...
Downloading and installing node 16.14.2...
Bootstrapping npm 8.5 (replacing 8.5.0)...
npm 8.5 installed
-----> Installing dependencies
Installing node modules
added 126 packages, and audited 127 packages in 2s
16 packages are looking for funding
run `npm fund` for details
found 0 vulnerabilities
-----> Build
Running build
> pokedex-bot-telegram#1.0.0 build
> node index.js
-----> Timed out running buildpack Node.js
Terminated
! Push failed
Below is the JSON extracted from the comments from your question. This helps with solving the issue.
{
"scripts": {
"start": "node index.js",
"build": "node index.js",
"dev": "nodemon index.js"
}
}
The solution is to delete the build step.
This is because start and build are doing the exact same things, so there's no point in running it twice.
When you remove the build part, and run it again, it should complete everything, without getting stuck on build.
Right now, I'm using Heroku to deploy my app from GitHub. Here's deploy output log:
-----> Building on the Heroku-20 stack
-----> Determining which buildpack to use for this app
-----> 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): 16.x
engines.npm (package.json): unspecified (use default)
Resolving node version 16.x...
Downloading and installing node 16.3.0...
Using default npm version: 7.15.1
-----> Installing dependencies
Installing node modules (package.json)
added 149 packages, and audited 150 packages in 9s
10 packages are looking for funding
run `npm fund` for details
found 0 vulnerabilities
-----> Build
-----> Caching build
- node_modules
-----> Pruning devDependencies
up to date, audited 150 packages in 866ms
10 packages are looking for funding
run `npm fund` for details
found 0 vulnerabilities
-----> Build succeeded!
-----> Discovering process types
Procfile declares types -> (none)
Default types for buildpack -> web
-----> Compressing...
Done: 48M
-----> Launching...
Released v3
https://dino-pack.herokuapp.com/ deployed to Heroku
However, when I go to dino-pack.herokuapp.com, it shows me this:
What is the problem, and how can I fix it? I've tried deleting and re-making the application, but it still shows this.
Check if your setup was done correctly, Procfile and the package.json. Follow a setup guide to double check. I'm sure it's a silly error but we need more info to find out what it is.
As near as I can tell from your logs there appears to be a path resolution issue. Some modules don't handle relative paths very well.
If you have an import somewhere that uses a relative path I would try changing that to either a relative format that works or first try an absolute path and see what shows up in the logs then.
This is just a guess since you don't want to share your code.
I am in a process of converting HTML files to pdf in python and attach these pdf files to mail and process it
I've installed pdfkit(0.6.1), wkhtmltopdf(0.2) and also wkhtmltopdf for windows. And added wkhtmltopdf bin path. It is working in my local system without any issue here is my code
url=""
PDF = pdfkit.from_url(url, False)
result= SendPDFtomail(PDF)
return result
When I tried to push the same code into heroku by adding the buildpack for wkhtmltopdf and buildpacks for my application are
1. heroku/python
2. https://github.com/dscout/wkhtmltopdf-buildpack.git
When i push my build to heroku
git push heroku master
Counting objects: 3, done.
Delta compression using up to 4 threads.
Compressing objects: 100% (3/3), done.
Writing objects: 100% (3/3), 336 bytes | 84.00 KiB/s, done.
Total 3 (delta 2), reused 0 (delta 0)
remote: Compressing source files... done.
remote: Building source:
remote:
remote: -----> Python app detected
remote: ! The latest version of Python 3.6 is python-3.6.6 (you
are using python-3.6.4, which is unsupported).
remote: ! We recommend upgrading by specifying the latest version
(python-3.6.6).
remote: Learn More:
https://devcenter.heroku.com/articles/python-runtimes
remote: -----> Installing requirements with pip
remote:
remote: -----> wkhtmltopdf app detected
remote: -----> Moving wkhtmltopdf binaries to /app/bin
remote: -----> Discovering process types
remote: Procfile declares types -> web
remote:
remote: -----> Compressing...
remote: Done: 103.8M
remote: -----> Launching...
remote: Released v19
remote: https://XXXXXXX.herokuapp.com/ deployed to
Heroku
remote:
remote: Verifying deploy... done.
my app was deployed without any issues and when am running the code in Heroku I am getting the error
Exception :No wkhtmltopdf executable found: "b''"
If this file exists please check that this process can read it.
Otherwise please install wkhtmltopdf -
https://github.com/JazzCore/python-pdfkit/wiki/Installing-wkhtmltopdf
which is the same error I received when I didn't add the wkhtmltopdf path to the system, As we can see in my build Moving wkhtmltopdf binaries to /app/bin, how can I make my Heroku configure to this wkhtmltopdf binary path? how can we use config vars in Heroku to make this work
I've tried this generating-pdfs-wkhtmltopdf-heroku but couldn't get it. And wherever I search am getting solutions for ruby that we need to configure the gem file, how can I do it in python
I've been working on it from past two days, Please help me out
Thanks in advance
Meghana Goud
I am now using OSX and heroku to deploy my flask app.
When deployed the heroku wkhtmltopdf binary is in ./bin/wkhtmltopdf.
So I wrote this code to deal with this.
if (platform.system() == 'Darwin'):
config = pdfkit.configuration()
else:
config = pdfkit.configuration(wkhtmltopdf='./bin/wkhtmltopdf')
I keep getting this error when I try to push my app to Heroku:
git push heroku master
Counting objects: 14, done.
Delta compression using up to 8 threads.
Compressing objects: 100% (13/13), done.
Writing objects: 100% (14/14), 3.18 KiB | 0 bytes/s, done.
Total 14 (delta 11), reused 0 (delta 0)
remote: Compressing source files... done.
remote: Building source:
remote:
remote: -----> Node.js app detected
remote: -----> Meteor version: Meteor 1.4.0.1
remote: -----> Checking if this meteor version supports --server-only
remote: cp: cannot stat ‘/app/tmp/cache/1.3.4.1/.meteor/packages/meteortool/.1.3.4_1.tskw1g++os.linux.x86_64+web.browser+web.cordova/mt-os.linux.x86_64/dev_bundle/bin/node\n/app/tmp/cache/1.3.4.1/.meteor/packages/meteor-tool/.1.4.0-1.1lf30np++os.linux.x86_64+web.browser+web.cordova/mt-os.linux.x86_64/dev_bundle/bin/node’: No such file or directory
remote: ! Push rejected, failed to compile Node.js app.
remote:
remote: ! Push failed
remote: Verifying deploy...
remote:
remote: ! Push rejected to [name-of-app].
What could the problem be? Just a few hours ago I managed to push with no errors.
Running this worked for me:
heroku config:set BUILDPACK_CLEAR_CACHE=1
It forced heroku to download meteor again and overwrite the version 1.4 that was updated automatically. If you are using the horse buildback check how the issue evolves: https://github.com/AdmitHub/meteor-buildpack-horse/issues/132
You need to clear the cache from the previous built, For that you have to install Heroku Repo plugin
heroku plugins:install heroku-repo
and clear your app cache by running repo:purge_cache.
if you have multiple apps don't forget to specify your appname
heroku repo:purge_cache
and then you could push your code
git push heroku master
The problem was actually a meteor version mismatch. I had to upgrade to meteor 1.4 which presented an issue of its own. If you have problems updating to 1.4, you could check out this thread