unfold / heroku-buildpack-pnpm Goto Github PK
View Code? Open in Web Editor NEWRun PNPM install on Heroku
License: MIT License
Run PNPM install on Heroku
License: MIT License
Describe the bug
With recent update I have an issue:
remote: Compressing source files... done.
remote: Building source:
remote:
remote: -----> Building on the Heroku-20 stack
remote: -----> Using buildpacks:
remote: 1. https://github.com/unfold/heroku-buildpack-pnpm
remote: 2. heroku/ruby
remote: -----> Node.js app detected
remote:
remote: -----> Creating runtime environment
remote:
remote: NPM_CONFIG_LOGLEVEL=error
remote: NODE_VERBOSE=false
remote: NODE_ENV=production
remote: NODE_MODULES_CACHE=true
remote:
remote: -----> Installing binaries
remote: engines.node (package.json): 16.15.1
remote: engines.npm (package.json): unspecified (use default)
remote:
remote: Resolving node version 16.15.1...
remote: Downloading and installing node 16.15.1...
remote: Using default npm version: 8.11.0
remote: -----> Install pnpm
remote: ==> Extracting pnpm binaries 7.1.9
remote: Could not infer shell type.
remote:
remote: Setup complete. Open a new terminal to start using pnpm.
remote: /tmp/codon/tmp/buildpacks/a4d02563694a7c675b0e6f14a16ea672fe9b6808/bin/compile: line 227: pnpm: command not found
remote:
remote: -----> Build failed
Versions (please complete the following information):
heroku-20
16.15.1
npm 8.11.0
remote: 1. https://github.com/unfold/heroku-buildpack-pnpm
remote: 2. heroku/ruby
Describe the bug
The documentation says that we can set the PNPM_VERSION env var to control which pnpm version is installed during the heroku build.
However, when we set the engines.pnpm in the package.json, the buildpack is using that value over the env var which is not what I'd expect reading the documentation.
For us, this is not a big deal, it was just surprising. I'm also not sure this was an intentional change or just a coincidence. Probably it's worth documenting and/or fixing.
I think this commit introduced this new behaviour.
To Reproduce
Steps to reproduce the behavior:
"engines": {
"node": "16.x",
"pnpm": "8.x"
}
Versions (please complete the following information):
heroku-22
16.20.0
NPM 8.19.4
latest
Additional context
Add any other context about the problem here.
Describe the bug
With the new version of buildpack, the script to respect engines.pnpm
seems to break pnpm install.
heroku-buildpack-pnpm/bin/compile
Lines 225 to 235 in 9a5caa9
Seeing this in logs
2023-04-04 16:41:17 Downloading and installing pnpm... /tmp/codon/tmp/buildpacks/6850fdb5590ef7398f98be618d4e33eed777eadc/bin/compile: line 233: pnpm: command not found
Looks like the script didn't wait until the install complete and start calling pnpm
.
I installed the buildpack on heroku, activated via corepack pnpm and then did a deployment test. The error message I get is the classic ERR_PNPM_PREPARE_PKG_FAILURE.
Packages are hard linked from the content-addressable store to the virtual store.
Content-addressable store is at: /app/.local/share/pnpm/store/v3
Virtual store is at: node_modules/.pnpm
ERR_PNPM_PREPARE_PKG_FAILURE Command failed with exit code 1: pnpm install
Progress: resolved 275, reused 273, downloaded 0, added 0
Steps to reproduce the behavior:
Describe the bug
Hey, I'm using dokku to deploy my nestjs app. It seems that my node modules are never cached, can anyone help me figure out why?
I see that it says pnpm (nothing to cache) and dont understand why isnt there anything to cache?
Here's the log:
https://gist.github.com/rohanrajpal/bc7cc3b14b3f7f3866826b0aea84f004
To Reproduce
Steps to reproduce the behavior:
Versions (please complete the following information):
Additional context
The build log shared above has a lot more details
My best guess is that the path of caching is set incorrectly? Happy to make a PR if someone can point me in the right direction to fix this
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 the Pruning 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
-----> Pruning devDependencies
devDependencies:
- ...
- nx 16.5.0
- ...
> [email protected] prepare /tmp/build_6499ea3f
> nx generate-css && nx generate-gql
sh: 1: nx: not found
ELIFECYCLE Command failed.
-----> Build failed
I'd like to have an option to skip installation of optional dependencies. Currently, this option sadly isn't supported even at the official Heroku node.js buildpack.
I believe the user should have the optional to add some boolean Heroku environment variable specifying weather to install optional deps. or not.
All the three package manager supports the option --no-optional. This saves time of installing testing or lintinting packages unnecessary for the final deployment.
Describe the bug
I am trying to deploy a landing page (next.js app) to heroku using monorepo architecture. The problem occurs while pruning devDependencies
. It tries to receive an input whether the devDependencies can be removed.
To Reproduce
Steps to reproduce the behavior:
Versions (please complete the following information):
Heroku Stack: heroku/8.7.1
Node Version: 20.11.0
PNPM Version: 8.15.0
turbo Version: ^1.11.3
Additional context
remote: -----> Pruning devDependencies
remote: ? The modules directory at "/tmp/build_bbb22d47/apps/backend/node_modules" will be removed and reinstalled from scratch. Proceed? (Y/n) ‣ ? The modules directory at "/tmp/build_bbb22d47/apps/console/node_modules" will be removed and reinstalled from scratch. Proceed? (Y/n) ‣ ? The modules directory at "/tmp/build_bbb22d47/packages/ts-config/node_modules" will be removed and reinstalled from scratch. Proceed? (Y/n) ‣ ? The modules directory at "/tmp/build_bbb22d47/packages/ui/node_modules" will be removed and reinstalled from scratch. Proceed? (Y/n) ‣ ? The modules directory at "/tmp/build_bbb22d47/apps/client/node_modules" will be removed and reinstalled from scratch. Proceed? (Y/n) ‣ ? The modules directory at "/tmp/build_bbb22d47/apps/landing-page/node_modules" will be removed and reinstalled from scratch. Proceed? (Y/n) ‣ (node:2325) MaxListenersExceededWarning: Possible EventEmitter memory leak detected. 11 keypress listeners added to [ReadStream]. Use emitter.setMaxListeners() to increase limit
remote: (Use `node --trace-warnings ...` to show where the warning was created)
remote:
remote: -----> Build succeeded!
remote: -----> Discovering process types
remote: Procfile declares types -> web
remote:
remote: -----> Compressing...
remote: ! Compiled slug size: 512.6M is too large (max is 500M).
remote: ! See: http://devcenter.heroku.com/articles/slug-size
remote:
remote: ! Push failed
remote: Verifying deploy...
remote:
remote: ! Push rejected to prayers-landing-page.
This is my folder architecture:
Describe the solution you'd like
I would like to force-prune the devDependencies. Or default set the answer yes. Don't know if it's even possible but throwing it out there.
Is your enhancement request related to a problem? Please describe.
I went to look for a release thinking it would be made for each version as described in the Changlelog.
Describe the solution you'd like
Ideally, each time a new version is published a GitHub release is created based on the code in the main
branch. Then we can use GitHub to see differences in versions and pull a specific release if needed.
Describe alternatives you've considered
Not sure if Heroku buildpacks have versions too.
Additional context
Nope
Is your enhancement request related to a problem? Please describe.
Many Node dependencies, such as TypeScript, are used as dev dependencies, meaning they are required to initially compile project, but are not required later in production. This means any project that relies on TS or other libraries to compile would fail during build time.
Describe the solution you'd like
Describe alternatives you've considered
Moving dependencies from dev to production list helps to solve immediate problem, but it in turn creates a problem of having dev dependencies in production, which is considered bad solution.
Running the install command curl -sL https://unpkg.com/@pnpm/self-installer | node
fails now with:
[stdin]:1
<!DOCTYPE html>
^
SyntaxError: Unexpected token '<'
at new Script (node:vm:100:7)
at createScript (node:vm:257:10)
at Object.runInThisContext (node:vm:305:10)
at node:internal/process/execution:81:19
at [stdin]-wrapper:6:22
at evalScript (node:internal/process/execution:80:60)
at node:internal/main/eval_stdin:29:5
at Socket.<anonymous> (node:internal/process/execution:212:5)
at Socket.emit (node:events:406:35)
at endReadableNT (node:internal/streams/readable:1329:12)
I think it's related to the latest commit: 76cf1fc
Can it be changed to the new URL so we're not using unpkg.com?
Hi,
I'm trying to use this buildpack, but it only works (builds) if I move everything from devDependencies to dependencies in package.json.
My errors :
husky: not found
when I move husky to dependencies, then I have tsc not found
, and so on.
Looks like it installs only the dep and not the devDep.
Any idea or some workarounds?
Thanks in advance
Is your enhancement request related to a problem? Please describe.
The size of our dependencies are way too big when used with a monorepo as it installs every dependency in the monorepo
Describe the solution you'd like
pnpm --filter=package install
allows you to selectively install dependencies for the repo you're working with to avoid having unused dependencies
Describe alternatives you've considered
You can just like... ignore it I guess but that's not really a solution. It's also not possible to delete dependencies after you install them without a ton of trouble
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.