I'm using the buildpack to install dependencies. My application has a prepare script which generates css classes and graphql codegen using the nx tool. The nx tool is a dev dependency. When building the app in Heroku the following steps take place:
pnpm install
prepare script runs
prod build script runs
dev dependencies are pruned
prepare script runs again
The build fails when step 5 attempts to run the prepare script as it requires dev dependencies.
To Reproduce
Steps to reproduce the behavior:
Deploy a next js app to heroku that has a dev dependency that is used in the prepare script
Create a manual deploy in Heroku
Notice that the prepare script attempts to run during the Pruning devDependencies step
Versions (please complete the following information):
Heroku Stack: heroku-22
Node Version: 20.4.0
NPM Version: npm 8.x
PNPM Version: 8.6.9
Buildpack Version: latest
Additional context
Log file for the Pruning devDependencies step in Heroku build
Describe the bug
I'm using the buildpack to install dependencies. My application has a
prepare
script which generates css classes and graphql codegen using the nx tool. The nx tool is a dev dependency. When building the app in Heroku the following steps take place:The build fails when step 5 attempts to run the
prepare
script as it requires dev dependencies.To Reproduce Steps to reproduce the behavior:
prepare
scriptprepare
script attempts to run during thePruning devDependencies
stepVersions (please complete the following information):
heroku-22
20.4.0
npm 8.x
8.6.9
latest
Additional context
Log file for the Pruning devDependencies step in Heroku build