-
-
Notifications
You must be signed in to change notification settings - Fork 295
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Patches not applied when using Heroku's Node buildpack #130
Comments
Immediately closing this as it's not a bug with |
I just ran into this again when setting up |
Looks like with the latest version of the Heroku nodejs build script, you can accomplish this by using the Here's what my
|
Actually, Heroku document says it runs after dependency caching, but it works for me anyway. |
@neokim suggestion to use |
I added
But no changes applyed. What am I doing wrong? |
@AlexanderPershin It worked for me I am also using strapi. So i added |
Warning: If you add |
Has anyone had this issue on digital ocean? |
@Previesam @AlexanderPershin For strapi staging, I added: |
The solution is to add the {
// ...
"scripts": {
"heroku-cleanup": "npx patch-package",
// ... Thanks to @IceBreaker8 above for the solve. |
This isn't an issue with
patch-package
specifically, but I wanted to share it here nonetheless to help anyone else who might run into this.When using Heroku's Node buildpack, by default the following will happen during the build and startup process:
devDependencies
) withyarn --production="false"
yarn --production="true"
However, at step 3 when the dev dependencies are pruned, the buildpack also specifies the
--ignore-scripts
flag when callingyarn
(since v119). This meanspatch-package
will not run, because thepostinstall
/prepare
scripts will not be ran. In turn, this means when the app runs, Node modules will not be patched (!).The only workaround I'm aware of at the moment is to disable pruning of dev dependencies with
YARN_PRODUCTION=false
.I can semi-understand why the buildpack would want to avoid invoking scripts, since the scripts were already run after step 1. In any case I've raised an issue with the buildpack to investigate what changes we can make there: heroku/heroku-buildpack-nodejs#634
The text was updated successfully, but these errors were encountered: