What is the reason for “Procfile declares types -> (none)” in Heroku?

前端 未结 11 1705
一整个雨季
一整个雨季 2020-12-14 09:06

I am trying to deploy a test app to Heroku --stack cedar but every time I do my Procfile is being ignored.

It should be saying this:

Procfile declare         


        
相关标签:
11条回答
  • 2020-12-14 09:39

    I have sth to say about "Procfile declares types -> (none)" error.

    One thing we should pay attention to is the hidden extension of "Procfile" file. I thought my command in "Procfile" was correct but I kept receiving this error. After half an hour I found that "Procfile" has the extension ".txt" but was hidden by the default setting of my macOS. After removing the extension, everything works fine!

    0 讨论(0)
  • 2020-12-14 09:42

    I'm adding to Pascal Lindelauf answer - make sure your file name is "Procfile" (with a capital P) and not "procfile" (that was the case with me just now) good luck!

    0 讨论(0)
  • 2020-12-14 09:43

    I had this problem deploying a Django app to Heroku.

    • the git repository has to be initialised in the Django project root folder (where manage.py lives)
    • this is also where the Procfile needs to sit

    File structure:

    Documents/
    |---djangoprojectname/
    |   |---djangoprojectname/
    |   |   |---__init__.py
    |   |   |---settings.py
    |   |   |---urls.py
    |   |   |---wsgi.py
    |   |---djangoappname/
    |   |---.git
    |   |---manage.py
    |   |---Procfile
    

    The Procfile should look like this as per the docs:

    web: gunicorn djangoprojectname.wsgi
    
    0 讨论(0)
  • 2020-12-14 09:46

    Did you remember to commit your Procfile to git? I've forgotten to do this commit, done a git push heroku master, and seen the (none) message stated above.

    If you've forgotten, then commit your Procfile and perform git push heroku master again.

    0 讨论(0)
  • 2020-12-14 09:46

    I was getting the same problem, and tried everything posted here. I was getting:

    Procfile declares types -> (none)
    

    Instead of Procfile declares types -> web. My fix was to change in the regedit to 0 (tutorial here https://www.thewindowsclub.com/show-file-extensions-in-windows) and then deleting the .txt in the end of Procfile (So It was just a file with no extension). After that my problem was solved! You can check if you have solved doing the following commands in the cmd:

    heroku ps 
    

    Should display something like:

    === web (Free): gunicorn app:app (1)
    

    Or the git push:

    git push heroku master
    

    And that should display:

    Procfile declares types -> web
    
    0 讨论(0)
提交回复
热议问题