Skip to content
New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

PROJECT_PATH is undefined #5

Open
619 opened this issue Aug 22, 2020 · 19 comments
Open

PROJECT_PATH is undefined #5

619 opened this issue Aug 22, 2020 · 19 comments

Comments

@619
Copy link

619 commented Aug 22, 2020

This is what I get when I follow the steps listed in the README.md

-----> Subdir buildpack app detected
PROJECT_PATH is undefined
! Push rejected, failed to compile Subdir buildpack app.
! Push failed

@mateussmohamed
Copy link

mateussmohamed commented Sep 15, 2020

@619 try to use app instead projects/nodejs/app only value in PROJECT_PATH environment variable

@Diego-Paris
Copy link

I'm getting the same error mentioned but the solution provided by @mateussmohamed does not work for me. Is there another approach to this error? PROJECT_PATH continues to be undefined.

@riggiobill
Copy link

Hello, I'm having the same error as well. I have "Code" as the only value in my right-hand box on Config Vars and I am getting the same message in error as well:

"PROJECT_PATH is undefined
! Push rejected, failed to compile Subdir buildpack app."

@JosephKilbane
Copy link

I fixed this by just removing the build pack and in my travis.yml file added in a before_script: cd frontEnd
My travis file is in the parent folder of the project

More to my answer here https://stackoverflow.com/questions/54878184/how-to-deploy-a-subfolder-in-repository-to-heroku-via-travis-ci/66025176#66025176

@sguridirt
Copy link

I had the same problem, but I was able to fix it.
My github repository structure that I was hosting on Heroku was like this:

repository_name/
├─ my_project_to_run/
│   ├─ run.py
│   ├─ ...

I had set the PROJECT_PATH config var to repository_name/my_project_to_run but it didn't work.

Instead, inspired by @mateussmohamed reply,

@619 try to use app instead projects/nodejs/app only value in PROJECT_PATH environment variable

I set the PROJECT_PATH config var to only my_project_to_run and it worked flawlessly.

Hope it helps. 👍

@gminetoma
Copy link

-----> Building on the Heroku-20 stack
-----> Using buildpacks:
1. https://github.com/timanovsky/subdir-heroku-buildpack.git
2. heroku/java
-----> Subdir buildpack app detected
PROJECT_PATH is undefined
! Push rejected, failed to compile Subdir buildpack app.
! Push failed

Same Error!!!! Any Fix!?

Already defined the PROJECT_PATH in the setting tab and nothing.

@SirawichDev
Copy link

@619 try to use app instead projects/nodejs/app only value in PROJECT_PATH environment variable

this solution worked for me. Thanks, my time saver!

@udemezue01
Copy link

it did not work for me

@msmans
Copy link

msmans commented Mar 22, 2022

Looks like if you have a single subdirectory, Heroku changes into it automatically and thus the build root is no longer your repository root. If that's the case, just add a subdirectory at root of your repo with a single empty file in it. E.g.

/my-project-dir/package.json
/empty-dir/.keep

@wandersonmaceds
Copy link

Looks like if you have a single subdirectory, Heroku changes into it automatically and thus the build root is not longer your repository root. If that's the case, just add a subdirectory at root of your repo with a single empty file in it. E.g.

/my-project-dir/package.json
/empty-dir/.keep

You're right, I did what you suggested and worked for me! Thanks!

@udemezue01
Copy link

udemezue01 commented Mar 31, 2022 via email

@Rajthegreat123
Copy link

My file structure is like
My_Username/Project_Name/server.js

what should i use as the project path

@udemezue01
Copy link

udemezue01 commented Aug 22, 2022 via email

@Rajthegreat123
Copy link

ok i am waiting

@udemezue01
Copy link

udemezue01 commented Aug 24, 2022 via email

@Gilsonlgd
Copy link

Gilsonlgd commented May 30, 2023

i had the same problem but i solved changing the path name from backend to Backend. It seems to be different to Heroku

@gosag15
Copy link

gosag15 commented Jan 18, 2025

In case someone still has an issue with this. None of the above worked for me. My folder structure was mainfolder/subfolder/app and the project path was set to mainfolder/subfolder/ but it failed. I tried all the combinations above and they all failed... the final solution that worked for me was just ./

@jitDotBlake
Copy link

heroku is about to stop supporting builds on heroku-20, has anybody gotten it to work on a later stack?

@whusterj
Copy link

@jitDotBlake - Yes, this is working for me on heroku-24. It works by running a very simple bash script, so I expect it will continue working for a long time.

The error PROJECT_PATH is undefined is misleading. It can happen when the PROJECT_PATH variable is defined, but your directory is not found. In my case, I was working on a branch that had the directory, but I pushed main to heroku, which didn't have the directory, and so I ended up here.

Anyway, PR #13 improves the error messaging. IMO, it should be merged!

# for free to join this conversation on GitHub. Already have an account? # to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests