Open Greenhv opened 4 years ago
Use this one it's works for sure! https://github.com/Automattic/node-canvas/issues/1448#issuecomment-506529976
As an ugly workaround, I ended up using the following now-build
.
$ wget https://github.com/jwerre/node-canvas-lambda/raw/master/canvas-lib64-layer.zip
$ unzip -j -d canvas_lib64 canvas-lib64-layer.zip
{
"scripts": {
"now-build": "cp canvas_lib64/*so.1 node_modules/canvas/build/Release/"
}
}
BTW, Thanks @jwerre !
Thanks so much! Worked like a charm.
FYI that "now-build" line needs to go into your package.json
, not your now.json
which is where I initially put that build step :)
I tried above and got Error: /lib64/libc.so.6: version GLIBC_2.25 not found
so this one works for me:
yum install libuuid-devel libmount-devel && cp /lib64/{libuuid,libmount,libblkid}.so.1 node_modules/canvas/build/Release/ && next build
I tried @likeablob 's solution (based on @tomer183 's comment) but deployment fails with an error during the build phase, saying "A routes-manifest.json couldn't be found":
Running "npm run now-build"
01:07:16 PM | > meme-generator@0.0.1 now-build /zeit/5f669098 01:07:16 PM | > cp canvas_lib64/*so.1 node_modules/canvas/build/Release/ 01:07:16 PM | Error: A routes-manifest.json couldn't be found. This could be due to a failure during the build 01:07:16 PM | at Object.getRoutesManifest (/zeit/6bf8589d5ea7fee8/.build-utils/.builder/node_modules/@now/next/dist/index.js:6057:15) 01:07:16 PM | at async Object.module.exports.178.exports.build (/zeit/6bf8589d5ea7fee8/.build-utils/.builder/node_modules/@now/next/dist/index.js:3823:28) 01:07:16 PM | at async buildStep (/var/task/sandbox-worker.js:20292:20) 01:07:16 PM | at async mainSub (/var/task/sandbox-worker.js:20047:9) 01:07:16 PM | at async main (/var/task/sandbox-worker.js:19975:5) 01:07:16 PM | worker exited with code 20 and signal null 01:07:19 PM | Done with "package.json"
Before adding this now-build
npm script, the deployment worked flawlessly, but of course I would then get the cannot open shared object file
runtime error this thread is all about...
I don't understand how copying a few extra files in there can completely break the build process. Any ideas?
@rocksell I'm not sure I understand your solution. Where are you using that line? In the now-build
script? Or are you just running this manually on your local setup? On my local setup, everything just works. Did you manage to deploy this to now?
@shawninder
I guess that's because your project is missing a next build
command since now-build
overrides a build
script.
When ZEIT Now encounters a package.json file with both build and now-build scripts, only now-build will be used. https://zeit.co/docs/v2/build-step
So, as @rocksell wrote, you might want to add yum install ... && next build
as your now-build
.
(In my case, a project just contains some Serverless Functions and thus does not require any build
step.)
Right you are @likeablob , thanks a lot!
2 noteworthy things:
yum install libuuid-devel libmount-devel && cp /lib64/{libuuid,libmount,libblkid}.so.1 node_modules/canvas/build/Release/
worked while the cp canvas_lib64/*so.1 node_modules/canvas/build/Release/
method (having downloaded and unzipped the files) did not work (for me).npm run build
from within my now-build
npm script.If it helps anyone, I ended up with this in my package.json:
"scripts": {
"test": "jest",
"dev": "next dev",
"build": "next build",
"now-build": "yum install libuuid-devel libmount-devel && cp /lib64/{libuuid,libmount,libblkid}.so.1 node_modules/canvas/build/Release/ && npm run build",
"start": "next start",
"deploy": "now"
},
a small comment to @shawninder 's answer here, which works like a charm by the way 🚀- worth checking what build command is configured in Zeit's dashboard under "Build & Development Settings" and set it to now-build
(as it seems mine was set to yarn build
by default)
technically yum install
should be called on postinstall
, but there is no such thing as now-postinstall
@shawninder you're the MVP – you helped me figure this out
I've solved this issue in a bit more complicated way:
added two commands to `package.json
"install-bin": "./scripts/install.sh",
"postinstall": "patch-package && (yarn run install-bin)"
where install.sh
is checking that target system is correct to run the command
#!/bin/bash
if ! [ -x "$(command -v yum)" ]; then
echo 'not a target system'
exit 0;
fi
yum install libuuid-devel libmount-devel && cp /lib64/{libuuid,libmount,libblkid}.so.1 node_modules/canvas/build/Release/
@shawninder you're the MVP – you helped me figure this out
Glad I could help :)
Unfortunately, this wasn't the end of my problems with node-canvas in the context of a Vercel deployment. Now that things are building, I'm finding I can't load any fonts... Perhaps someone here would be able to give me a hand via this stackoverflow post: https://stackoverflow.com/questions/60103921/node-canvas-registerfont-cant-find-font-file-once-deployed-works-locally
@shawninder this works for me:
import { loadImage, createCanvas, registerFont } from 'canvas';
import path from 'path';
registerFont(path.resolve('./public/CircularPro-Book.otf'), { family: 'CircularPro' });
@mschonvogel Does it also work once deployed to vercel?
@mschonvogel Does it also work once deployed to vercel?
Yep, works on vercel for me
Thank you so much @mschonvogel it worked!
I guess it was the path.resolve
that I needed. Perhaps when I had tried it earlier something else was wrong?
Sorry for highjacking the thread everyone, but this really did help!
Thank you @shawninder!
I've solved this issue in a bit more complicated way:
- added two commands to `package.json
"install-bin": "./scripts/install.sh", "postinstall": "patch-package && (yarn run install-bin)"
- where
install.sh
is checking that target system is correct to run the command#!/bin/bash if ! [ -x "$(command -v yum)" ]; then echo 'not a target system' exit 0; fi yum install libuuid-devel libmount-devel && cp /lib64/{libuuid,libmount,libblkid}.so.1 node_modules/canvas/build/Release/
I get this after everything:
ERROR Error: /lib64/libz.so.1: version `ZLIB_1.2.9' not found (required by /var/task/node_modules/canvas/build/Release/libpng16.so.16)
switched to node 12 runtime and it just started working \o/ Still have the weird yum install hack in my package.json, though, looks like:
"scripts": {
"vercel-build": "yum install libuuid-devel libmount-devel zlib && cp /lib64/{libuuid,libmount,libblkid,libz}.so.1 node_modules/canvas/build/Release/"
}
For Vercel, installing libuuid-devel, libmount-devel and copying libuuid.so.1, libmount.so.1, libblkid.so.1 worked for me. Didn't need to zlib, Node.js 12.x was set from the settings. I was drawing texts and it turned out to be corrupted boxes. May be no font is installed in the container runtime (I think it should be expected as it's a container, it shouldn't need fonts in the first place).
path.resolve()
didn't work for me at all, but based on a Vercel help page I got this working by making a folder in api/
, adding it to includeFiles
in vercel.json
, and using __dirname
: https://stackoverflow.com/a/67361187/362030
(I did need both zlib and Node.js 12.x. I tried just one or the other, didn't work for me.)
path.resolve()
didn't work for me at all, but based on a Vercel help page I got this working by making a folder inapi/
, adding it toincludeFiles
invercel.json
, and using__dirname
: https://stackoverflow.com/a/67361187/362030(I did need both zlib and Node.js 12.x. I tried just one or the other, didn't work for me.)
path.resolve()
is working for me. BUT, I use lerna
for project management and node-canvas
is isolated in it's own package. So, the behavior for a node_module package folder and the Next.js app may vary.
@elmariachi111 Wow thanks so much, spent 2 days on this error, downgrading to node 12.x was the only working solution... Would love if someone finds a way to fix it on Node 14 too..
The easiest way out that I've found was to downgrade to canvas@2.6.1
. This version of node-canvas does not require newer versions of libuuid-devel, libmount-devel and zlib, and it works in Vercel Node14 runtime without any extra dependencies. In case if you need to use node-canvas 2.7.0+, you'd most likely have to build zlib-1.2.9 from sources and copy libs from /lib64/
to node_modules/canvas/build/Release/
in the vercel-build script, as it was suggested above, well at least until zlib-1.2.9 becomes available through yum.
@rzinurov still get the same error using canvas@2.6.1
Just fought this for the better part of 4 hours. There seems to be a lot of advice across a few different GitHub issues, none of which worked for me on their own. First missing libraries(libuuid
), then a wrong/missing version of zlib
(ZLIB_1.2.9 not found (required by /opt/nodejs/node_modules/canvas/build/Release/libpng16.so.16)
).
Here's what finally ended up working for me:
Node: 14.x canvas: ^2.8.0
Add a setup.sh
file to the project :
wget https://zlib.net/fossils/zlib-1.2.9.tar.gz
tar -xf zlib-1.2.9.tar.gz
cd zlib-1.2.9
sh configure
make
ls -l libz*
cp libz.so.1 ../node_modules/canvas/build/Release/
Update package.json
with a vercel-build
script to handle installing the missing packages:
"vercel-build": "yum install libuuid-devel libmount-devel wget && cp /lib64/{libuuid,libmount,libblkid}.so.1 node_modules/canvas/build/Release/ && ./setup.sh && npm run build"
vercel-build
command, including zlibLD_LIBRARY_PATH
or LD_PRELOAD
environment variables@fuzzylimes Thanks a lot for your commit, I'm going through the same stuff and gave up at this point.
I tried to reproduce your solution, but still have the Error: /lib64/libz.so.1: version
ZLIB_1.2.9' not found`
By looking at the build log I spotted a suspicious rm -f libz.so libz.so.1
during the make install.
Unfortunately, the 400 lines of the zlib's makefile are too obscure to me, so if anyone have an idea, i would be very grateful! 🙏
Edited: I'm kind of tired, I just didn't saw the two ln -s
line below the rm one >.<
So I still have now clue
Last night I also kept getting this build error when deploying a Next.js app (https://github.com/john-raymon/custom-merch-shop) with a "fabric" NPM dependency (fabric.js, which internally uses node-canvas) to Vercel.
"Error: /lib64/libz.so.1: version `ZLIB_1.2.9' not found (required by
/vercel/path0/node_modules/canvas/build/Release/libpng16.so.16)"
This didn't work for me; including the vercel-build
script hack, suggested on this thread 👎🏽❌
switched to node 12 runtime and it just started working \o/ Still have the weird yum install hack in my package.json, though, looks like:
"scripts": { "vercel-build": "yum install libuuid-devel libmount-devel zlib && cp /lib64/{libuuid,libmount,libblkid,libz}.so.1 node_modules/canvas/build/Release/" }
Switching to deploying on Heroku worked for me, I removed the vercel-build
script and instead modified my start
script tag 👍🏽👇🏼
- "start": "next start"
+ "start": "next start -p $PORT"
Just fought this for the better part of 4 hours. There seems to be a lot of advice across a few different GitHub issues, none of which worked for me on their own. First missing libraries(
libuuid
), then a wrong/missing version ofzlib
(ZLIB_1.2.9 not found (required by /opt/nodejs/node_modules/canvas/build/Release/libpng16.so.16)
).Here's what finally ended up working for me:
Node: 14.x canvas: ^2.8.0
- Add a
setup.sh
file to the project :wget https://zlib.net/fossils/zlib-1.2.9.tar.gz tar -xf zlib-1.2.9.tar.gz cd zlib-1.2.9 sh configure make ls -l libz* cp libz.so.1 ../node_modules/canvas/build/Release/
- Update
package.json
with avercel-build
script to handle installing the missing packages:"vercel-build": "yum install libuuid-devel libmount-devel wget && cp /lib64/{libuuid,libmount,libblkid}.so.1 node_modules/canvas/build/Release/ && ./setup.sh && npm run build"
Things that didn't work for me
- Just using the
vercel-build
command, including zlib- Setting the
LD_LIBRARY_PATH
orLD_PRELOAD
environment variables
I'm getting permissions denied when trying to execute the sh, how did you do it?
I have a working config. I hope the explanations will help. Don't hesitate to ask for precision on stuff I've may have forgot to share :)
My setup include:
"scripts": {
"build": "next build",
"vercel-build": "yum install libuuid-devel libmount-devel zlib && cp /lib64/{libuuid,libmount,libblkid,libz}.so.1 node_modules/canvas/build/Release/ && npm run build",
},
LD_LIBRARY_PATH
/ LD_PRELOAD
env variablesMy use case was to create a social card for Open Graph, so i have a /api/social-image.png.js file with this as default function:
export default async (req, res) => {
const image = await createImage()
res.writeHead(200, {
"Content-Type": "image/png",
"Content-Length": Buffer.byteLength(image),
})
res.end(image);
}
createImage
being the function who calls node-canvas
some of the dependencies is now broken,
Error: Package: glibc-2.26-48.amzn2.i686 (amzn2-core)
Added --skip-broken to the yum command to make it work, but really.. Sounds weird
I ended up having to manually generate my libz.so.1
file from zlib-1.2.9
, because yum would only install v1.2.7+(some amazon suffix) from vercel-build
. I also went ahead and manually added all the other *.so
files that canvas needs (ie libblkid.so.1
, etc.) in a arbitrary root folder. Then I run vercel-build
to copy the files from that root folder into build/Release
.
So mine ended up looking like this:
"vercel-build": "cp canvas_lib64/* node_modules/canvas/build/Release/ && npm run build"
and the files I added to canvas_lib64
were:
libblkid.so.1
libfontconfig.so.1
libmount.so.1
libpixman-1.so.0
libpng16.so.16
libuuid.so.1
libz.so.1 (manually renamed this after explicity importing libz.so.1.2.9)
That seems to have solved it for me.
I ended up having to manually generate my
libz.so.1
file fromzlib-1.2.9
, because yum would only install v1.2.7+(some amazon suffix) fromvercel-build
. I also went ahead and manually added all the other*.so
files that canvas needs (ielibblkid.so.1
, etc.) in a arbitrary root folder. Then I runvercel-build
to copy the files from that root folder intobuild/Release
.So mine ended up looking like this:
"vercel-build": "cp canvas_lib64/* node_modules/canvas/build/Release/ && npm run build"
and the files I added to
canvas_lib64
were:libblkid.so.1 libfontconfig.so.1 libmount.so.1 libpixman-1.so.0 libpng16.so.16 libuuid.so.1 libz.so.1 (manually renamed this after explicity importing libz.so.1.2.9)
That seems to have solved it for me.
@chrisco255 When I try this I get cp: cannot stat ‘canvas_lib64/*’: No such file or directory
- "vercel-build": "yum install libuuid-devel libmount-devel zlib && cp /lib64/{libuuid,libmount,libblkid,libz}.so.1 node_modules/canvas/build/Release/ && npm run build",
@TixieBorg When trying this I get this error:
17:35:21.479 | npm ERR! missing script: build
-- | --
17:35:21.487 | npm ERR! A complete log of this run can be found in:
17:35:21.487 | npm ERR! /vercel/.npm/_logs/2021-10-10T00_35_21_480Z-debug.log
17:35:21.503 | error Command failed with exit code 1.
17:35:21.503 | info Visit https://yarnpkg.com/en/docs/cli/run for documentation about this command.
17:35:21.521 | Error: Command "yarn run vercel-build" exited with 1
@kgn Do you have a build script in your package.json? something like:
"scripts": {
"dev": "next dev",
"build": "next build",
"start": "next start",
"vercel-build": "yum install libuuid-devel libmount-devel zlib && cp /lib64/{libuuid,libmount,libblkid,libz}.so.1 node_modules/canvas/build/Release/ && npm run build",
},
I edited the original comment to make it more explicit
I have a working config. I hope the explanations will help. Don't hesitate to ask for precision on stuff I've may have forgot to share :)
My setup include:
- at least those npm scripts:
"scripts": { "build": "next build", "vercel-build": "yum install libuuid-devel libmount-devel zlib && cp /lib64/{libuuid,libmount,libblkid,libz}.so.1 node_modules/canvas/build/Release/ && npm run build", },
- node-canvas ^2.6.1 (don't work on the last version for me)
- last version of Next.js
- the node default version on Vercel (14.x, no need to stay on 12.x) and:
- no setup.sh
- no
LD_LIBRARY_PATH
/LD_PRELOAD
env variablesMy use case was to create a social card for Open Graph, so i have a /api/social-image.png.js file with this as default function:
export default async (req, res) => { const image = await createImage() res.writeHead(200, { "Content-Type": "image/png", "Content-Length": Buffer.byteLength(image), }) res.end(image); }
createImage
being the function who calls node-canvas
I tried a number of possible combinations of solutions suggested between three different threads. This is the only one that has worked for me. Thank you @TixieBorg
I have a working config. I hope the explanations will help. Don't hesitate to ask for precision on stuff I've may have forgot to share :)
My setup include:
- at least those npm scripts:
"scripts": { "build": "next build", "vercel-build": "yum install libuuid-devel libmount-devel zlib && cp /lib64/{libuuid,libmount,libblkid,libz}.so.1 node_modules/canvas/build/Release/ && npm run build", },
- node-canvas ^2.6.1 (don't work on the last version for me)
- last version of Next.js
- the node default version on Vercel (14.x, no need to stay on 12.x) and:
- no setup.sh
- no
LD_LIBRARY_PATH
/LD_PRELOAD
env variablesMy use case was to create a social card for Open Graph, so i have a /api/social-image.png.js file with this as default function:
export default async (req, res) => { const image = await createImage() res.writeHead(200, { "Content-Type": "image/png", "Content-Length": Buffer.byteLength(image), }) res.end(image); }
createImage
being the function who calls node-canvas
This works for me on staging build but doesn't work in production build which I have no idea why...
@jackguoAtJogg Do you have logs during the prod build that could help?
@TixieBorg Yep, here it is:
Retrieving list of deployment files...
--
09:39:19.728 | Downloading 276 deployment files...
09:39:23.540 | Analyzing source code...
09:39:23.618 | Warning: Due to `builds` existing in your configuration file, the Build and Development Settings defined in your Project Settings will not apply. Learn More: https://vercel.link/unused-build-settings
09:39:24.909 | Installing build runtime...
09:39:27.475 | Build runtime installed: 2.566s
09:39:30.768 | Looking up build cache...
09:39:30.999 | Build Cache not found
09:39:32.213 | Warning: Due to "engines": { "node": ">=14.x" } in your `package.json` file, the Node.js Version defined in your Project Settings ("14.x") will not apply. Learn More: http://vercel.link/node-version
09:39:32.221 | Installing dependencies...
09:39:32.475 | yarn install v1.22.17
09:39:32.573 | [1/5] Validating package.json...
09:39:32.576 | [2/5] Resolving packages...
09:39:33.060 | [3/5] Fetching packages...
09:39:59.210 | [4/5] Linking dependencies...
09:39:59.215 | warning " > @bit/jogg.jogg-component-library.api@1.11.9" has incorrect peer dependency "react@^16.11.0".
09:39:59.215 | warning " > @bit/jogg.jogg-component-library.api@1.11.9" has incorrect peer dependency "react-dom@^16.11.0".
09:39:59.215 | warning " > @bit/jogg.jogg-component-library.button@1.4.7" has incorrect peer dependency "react@^16.11.0".
09:39:59.216 | warning " > @bit/jogg.jogg-component-library.button@1.4.7" has incorrect peer dependency "react-dom@^16.11.0".
09:39:59.216 | warning "@bit/jogg.jogg-component-library.button > @bit/jogg.jogg-component-library.global-style@1.1.3" has incorrect peer dependency "react@^16.11.0".
09:39:59.216 | warning "@bit/jogg.jogg-component-library.button > @bit/jogg.jogg-component-library.global-style@1.1.3" has incorrect peer dependency "react-dom@^16.11.0".
09:39:59.216 | warning " > @bit/jogg.jogg-component-library.global-style@1.1.7" has incorrect peer dependency "react@^16.11.0".
09:39:59.216 | warning " > @bit/jogg.jogg-component-library.global-style@1.1.7" has incorrect peer dependency "react-dom@^16.11.0".
09:39:59.217 | warning " > @bit/jogg.jogg-component-library.global-style@1.1.7" has incorrect peer dependency "@types/react@16.9.11".
09:39:59.217 | warning " > @bit/jogg.jogg-component-library.global-style@1.1.7" has unmet peer dependency "@types/react-dom@16.9.4".
09:39:59.217 | warning " > @bit/jogg.jogg-component-library.inputs@1.10.12" has incorrect peer dependency "react@^16.11.0".
09:39:59.217 | warning " > @bit/jogg.jogg-component-library.inputs@1.10.12" has incorrect peer dependency "react-dom@^16.11.0".
09:39:59.218 | warning "@bit/jogg.jogg-component-library.inputs > @bit/jogg.jogg-component-library.global-style@1.1.2" has incorrect peer dependency "react@^16.11.0".
09:39:59.218 | warning "@bit/jogg.jogg-component-library.inputs > @bit/jogg.jogg-component-library.global-style@1.1.2" has incorrect peer dependency "react-dom@^16.11.0".
09:39:59.218 | warning " > @bit/jogg.jogg-component-library.jogg-player@1.0.2" has incorrect peer dependency "react@^16.11.0".
09:39:59.219 | warning " > @bit/jogg.jogg-component-library.jogg-player@1.0.2" has incorrect peer dependency "react-dom@^16.11.0".
09:39:59.219 | warning " > @bit/jogg.jogg-component-library.jogg-player@1.0.2" has incorrect peer dependency "@types/react@16.9.11".
09:39:59.219 | warning " > @bit/jogg.jogg-component-library.jogg-player@1.0.2" has unmet peer dependency "@types/react-dom@16.9.4".
09:39:59.219 | warning " > @bit/jogg.jogg-component-library.legal@1.1.3" has incorrect peer dependency "react@^16.11.0".
09:39:59.220 | warning " > @bit/jogg.jogg-component-library.legal@1.1.3" has incorrect peer dependency "react-dom@^16.11.0".
09:39:59.220 | warning " > @bit/jogg.jogg-component-library.legal@1.1.3" has incorrect peer dependency "@types/react@16.9.11".
09:39:59.221 | warning " > @bit/jogg.jogg-component-library.legal@1.1.3" has unmet peer dependency "@types/react-dom@16.9.4".
09:39:59.221 | warning " > @bit/jogg.jogg-component-library.loaders@1.1.1" has incorrect peer dependency "react@^16.11.0".
09:39:59.222 | warning " > @bit/jogg.jogg-component-library.loaders@1.1.1" has incorrect peer dependency "react-dom@^16.11.0".
09:39:59.222 | warning " > @bit/jogg.jogg-component-library.modal@1.2.2" has incorrect peer dependency "react@^16.11.0".
09:39:59.222 | warning " > @bit/jogg.jogg-component-library.modal@1.2.2" has incorrect peer dependency "react-dom@^16.11.0".
09:39:59.222 | warning " > @bit/jogg.jogg-component-library.pagination@1.1.1" has incorrect peer dependency "react@^16.11.0".
09:39:59.222 | warning " > @bit/jogg.jogg-component-library.pagination@1.1.1" has incorrect peer dependency "react-dom@^16.11.0".
09:39:59.222 | warning "@bit/jogg.jogg-component-library.pagination > react-paginate@6.5.0" has incorrect peer dependency "react@^16.0.0".
09:39:59.223 | warning " > @bit/jogg.jogg-component-library.progressbar@1.1.1" has incorrect peer dependency "react@^16.11.0".
09:39:59.223 | warning " > @bit/jogg.jogg-component-library.progressbar@1.1.1" has incorrect peer dependency "react-dom@^16.11.0".
09:39:59.223 | warning " > @bit/jogg.jogg-component-library.tabs@2.0.8" has incorrect peer dependency "react@^16.11.0".
09:39:59.223 | warning " > @bit/jogg.jogg-component-library.tabs@2.0.8" has incorrect peer dependency "react-dom@^16.11.0".
09:39:59.224 | warning "@bit/jogg.jogg-component-library.tabs > @bit/jogg.jogg-component-library.button@1.3.2" has incorrect peer dependency "react@^16.11.0".
09:39:59.224 | warning "@bit/jogg.jogg-component-library.tabs > @bit/jogg.jogg-component-library.button@1.3.2" has incorrect peer dependency "react-dom@^16.11.0".
09:39:59.224 | warning " > @bit/jogg.jogg-component-library.video-recorder@1.3.3" has incorrect peer dependency "react@^16.11.0".
09:39:59.224 | warning " > @bit/jogg.jogg-component-library.video-recorder@1.3.3" has incorrect peer dependency "react-dom@^16.11.0".
09:39:59.224 | warning " > @bit/jogg.jogg-component-library.video-recorder@1.3.3" has incorrect peer dependency "@types/react@16.9.11".
09:39:59.224 | warning " > @bit/jogg.jogg-component-library.video-recorder@1.3.3" has unmet peer dependency "@types/react-dom@16.9.4".
09:39:59.225 | warning "@bit/jogg.jogg-component-library.video-recorder > react-video-recorder@3.19.1" has incorrect peer dependency "react@^16.8.3".
09:39:59.225 | warning "@bit/jogg.jogg-component-library.video-recorder > react-video-recorder@3.19.1" has incorrect peer dependency "react-dom@^16.8.3".
09:39:59.225 | warning "@bit/jogg.jogg-component-library.video-recorder > react-video-recorder@3.19.1" has incorrect peer dependency "styled-components@^4.1.1".
09:39:59.225 | warning "@bit/jogg.jogg-component-library.video-recorder > react-video-recorder > react-svg-inline@2.1.1" has incorrect peer dependency "react@^0.14.9 \|\| ^15.3.0 \|\| ^16.0.0".
09:39:59.225 | warning " > @brainhubeu/react-carousel@2.0.4" has incorrect peer dependency "react@^16.8.0".
09:39:59.226 | warning " > @brainhubeu/react-carousel@2.0.4" has incorrect peer dependency "react-dom@^16.8.0".
09:39:59.226 | warning " > @bugsnag/plugin-react@7.13.2" has unmet peer dependency "@bugsnag/core@^7.0.0".
09:39:59.230 | warning " > styled-components@5.3.3" has unmet peer dependency "react-is@>= 16.8.0".
09:40:26.934 | [5/5] Building fresh packages...
09:40:51.559 | Done in 79.09s.
09:40:51.589 | Detected Next.js version: 11.1.2
09:40:51.590 | Running "yarn run vercel-build"
09:40:51.871 | yarn run v1.22.17
09:40:51.916 | $ yum install libuuid-devel libmount-devel zlib && cp /lib64/{libuuid,libmount,libblkid,libz}.so.1 node_modules/canvas/build/Release/ && npm run build
09:40:55.434 | Package zlib-1.2.7-18.amzn2.x86_64 already installed and latest version
09:40:55.435 | Resolving Dependencies
09:40:55.435 | --> Running transaction check
09:40:55.436 | ---> Package libmount-devel.x86_64 0:2.30.2-2.amzn2.0.5 will be installed
09:40:55.439 | --> Processing Dependency: pkgconfig(blkid) for package: libmount-devel-2.30.2-2.amzn2.0.5.x86_64
09:40:55.628 | ---> Package libuuid-devel.x86_64 0:2.30.2-2.amzn2.0.5 will be installed
09:40:55.629 | --> Running transaction check
09:40:55.629 | ---> Package libblkid-devel.x86_64 0:2.30.2-2.amzn2.0.5 will be installed
09:40:55.799 | --> Finished Dependency Resolution
09:40:55.812 |
09:40:55.812 | Dependencies Resolved
09:40:55.814 |
09:40:55.814 | ================================================================================
09:40:55.815 | Package Arch Version Repository Size
09:40:55.815 | ================================================================================
09:40:55.815 | Installing:
09:40:55.815 | libmount-devel x86_64 2.30.2-2.amzn2.0.5 amzn2-core 76 k
09:40:55.815 | libuuid-devel x86_64 2.30.2-2.amzn2.0.5 amzn2-core 86 k
09:40:55.815 | Installing for dependencies:
09:40:55.815 | libblkid-devel x86_64 2.30.2-2.amzn2.0.5 amzn2-core 75 k
09:40:55.815 |
09:40:55.815 | Transaction Summary
09:40:55.815 | ================================================================================
09:40:55.815 | Install 2 Packages (+1 Dependent package)
09:40:55.815 |
09:40:55.815 | Total download size: 238 k
09:40:55.815 | Installed size: 67 k
09:40:55.815 | Downloading packages:
09:40:56.022 | --------------------------------------------------------------------------------
09:40:56.023 | Total 1.1 MB/s \| 238 kB 00:00
09:40:56.028 | Running transaction check
09:40:56.032 | Running transaction test
09:40:56.044 | Transaction test succeeded
09:40:56.044 | Running transaction
09:40:56.107 | Installing : libuuid-devel-2.30.2-2.amzn2.0.5.x86_64 1/3
09:40:56.126 | Installing : libblkid-devel-2.30.2-2.amzn2.0.5.x86_64 2/3
09:40:56.142 | Installing : libmount-devel-2.30.2-2.amzn2.0.5.x86_64 3/3
09:40:56.155 | Verifying : libblkid-devel-2.30.2-2.amzn2.0.5.x86_64 1/3
09:40:56.166 | Verifying : libuuid-devel-2.30.2-2.amzn2.0.5.x86_64 2/3
09:40:56.214 | Verifying : libmount-devel-2.30.2-2.amzn2.0.5.x86_64 3/3
09:40:56.215 |
09:40:56.215 | Installed:
09:40:56.215 | libmount-devel.x86_64 0:2.30.2-2.amzn2.0.5
09:40:56.215 | libuuid-devel.x86_64 0:2.30.2-2.amzn2.0.5
09:40:56.215 |
09:40:56.215 | Dependency Installed:
09:40:56.215 | libblkid-devel.x86_64 0:2.30.2-2.amzn2.0.5
09:40:56.215 |
09:40:56.216 | Complete!
09:40:56.473 | npm WARN lifecycle The node binary used for scripts is /tmp/yarn--1636738851920-0.9875625545793345/node but npm is using /node14/bin/node itself. Use the `--scripts-prepend-node-path` option to include the path for the node binary npm was executed with.
09:40:56.474 |
09:40:56.474 | > consumer-web@2.3.13 build /vercel/path1
09:40:56.474 | > next build
09:40:56.474 |
09:40:57.296 | info - Using webpack 5. Reason: Enabled by default https://nextjs.org/docs/messages/webpack5
09:40:57.437 | Attention: Next.js now collects completely anonymous telemetry regarding usage.
09:40:57.437 | This information is used to shape Next.js' roadmap and prioritize features.
09:40:57.437 | You can learn more, including how to opt-out if you'd not like to participate in this anonymous program, by visiting the following URL:
09:40:57.437 | https://nextjs.org/telemetry
09:40:57.437 |
09:40:57.564 | info - Checking validity of types...
09:41:06.897 | warn - The Next.js plugin was not detected in your ESLint configuration. See https://nextjs.org/docs/basic-features/eslint#migrating-existing-config
09:41:07.946 |
09:41:07.946 | ./pages/404.tsx
09:41:07.946 | 3:10 Warning: 'jsx' is defined but never used. @typescript-eslint/no-unused-vars
09:41:07.947 |
09:41:07.947 | ./pages/_app.tsx
09:41:07.947 | 12:5 Warning: Missing return type on function. @typescript-eslint/explicit-module-boundary-types
09:41:07.947 |
09:41:07.947 | ./pages/_document.tsx
09:41:07.947 | 5:5 Warning: Missing return type on function. @typescript-eslint/explicit-module-boundary-types
09:41:07.947 | 5:34 Warning: Argument 'ctx' should be typed with a non-any type. @typescript-eslint/explicit-module-boundary-types
09:41:07.947 | 5:39 Warning: Unexpected any. Specify a different type. @typescript-eslint/no-explicit-any
09:41:07.947 | 10:5 Warning: Missing return type on function. @typescript-eslint/explicit-module-boundary-types
09:41:07.948 |
09:41:07.948 | ./pages/_error.tsx
09:41:07.948 | 6:22 Warning: Unexpected any. Specify a different type. @typescript-eslint/no-explicit-any
09:41:07.948 |
09:41:07.948 | ./pages/jogg-not-ready.tsx
09:41:07.948 | 3:10 Warning: 'jsx' is defined but never used. @typescript-eslint/no-unused-vars
09:41:07.948 |
09:41:07.949 | ./pages/not-found.tsx
09:41:07.949 | 4:10 Warning: 'jsx' is defined but never used. @typescript-eslint/no-unused-vars
09:41:07.949 |
09:41:07.949 | ./pages/not-live.tsx
09:41:07.949 | 3:10 Warning: 'jsx' is defined but never used. @typescript-eslint/no-unused-vars
09:41:07.949 |
09:41:07.950 | ./pages/notAuthorized.tsx
09:41:07.950 | 3:10 Warning: 'jsx' is defined but never used. @typescript-eslint/no-unused-vars
09:41:07.950 |
09:41:07.950 | ./pages/r/[promptId]/clip.tsx
09:41:07.950 | 14:11 Warning: Unexpected any. Specify a different type. @typescript-eslint/no-explicit-any
09:41:07.950 |
09:41:07.950 | ./pages/review/survey/[shortCode].tsx
09:41:07.951 | 44:54 Warning: Unexpected any. Specify a different type. @typescript-eslint/no-explicit-any
09:41:07.951 |
09:41:07.951 | ./pages/upload/error.tsx
09:41:07.951 | 3:10 Warning: 'jsx' is defined but never used. @typescript-eslint/no-unused-vars
09:41:07.951 |
09:41:07.951 | ./pages/upload/success.tsx
09:41:07.957 | 3:10 Warning: 'jsx' is defined but never used. @typescript-eslint/no-unused-vars
09:41:07.957 |
09:41:07.957 | ./components/ClipPageComponent/ClipPageBody.tsx
09:41:07.957 | 3:10 Warning: 'jsx' is defined but never used. @typescript-eslint/no-unused-vars
09:41:07.957 |
09:41:07.957 | ./components/ClipPageComponent/ClipPageComponent.tsx
09:41:07.958 | 3:10 Warning: 'jsx' is defined but never used. @typescript-eslint/no-unused-vars
09:41:07.958 |
09:41:07.958 | ./components/ClipPageComponent/ClipPageError.tsx
09:41:07.958 | 3:10 Warning: 'jsx' is defined but never used. @typescript-eslint/no-unused-vars
09:41:07.958 |
09:41:07.958 | ./components/FavoriteVideoList/FavoriteVideoList.tsx
09:41:07.958 | 4:10 Warning: 'jsx' is defined but never used. @typescript-eslint/no-unused-vars
09:41:07.958 |
09:41:07.958 | ./components/FavoriteVideoList/FavoriteVideoListItem.tsx
09:41:07.958 | 4:10 Warning: 'jsx' is defined but never used. @typescript-eslint/no-unused-vars
09:41:07.958 |
09:41:07.958 | ./components/Footer/Footer.tsx
09:41:07.958 | 3:10 Warning: 'jsx' is defined but never used. @typescript-eslint/no-unused-vars
09:41:07.958 |
09:41:07.959 | ./components/JoggAwesomeQrCode/JoggAwesomeQrCode.tsx
09:41:07.959 | 15:32 Warning: Unexpected any. Specify a different type. @typescript-eslint/no-explicit-any
09:41:07.959 | 26:53 Warning: Unexpected any. Specify a different type. @typescript-eslint/no-explicit-any
09:41:07.959 | 29:44 Warning: Unexpected any. Specify a different type. @typescript-eslint/no-explicit-any
09:41:07.959 |
09:41:07.959 | ./components/JoggInfoContent/JoggDetailList.tsx
09:41:07.959 | 4:10 Warning: 'jsx' is defined but never used. @typescript-eslint/no-unused-vars
09:41:07.959 |
09:41:07.959 | ./components/JoggInfoContent/JoggInfoContent.tsx
09:41:07.959 | 4:10 Warning: 'jsx' is defined but never used. @typescript-eslint/no-unused-vars
09:41:07.959 | 41:30 Warning: Unexpected any. Specify a different type. @typescript-eslint/no-explicit-any
09:41:07.959 |
09:41:07.959 | ./components/JoggPage/JoggInfoSection/InfoContent.tsx
09:41:07.959 | 3:10 Warning: 'jsx' is defined but never used. @typescript-eslint/no-unused-vars
09:41:07.959 | 42:16 Warning: Unexpected any. Specify a different type. @typescript-eslint/no-explicit-any
09:41:07.959 |
09:41:07.959 | ./components/JoggPage/JoggInfoSection/InfoHeader.tsx
09:41:07.959 | 3:10 Warning: 'jsx' is defined but never used. @typescript-eslint/no-unused-vars
09:41:07.960 |
09:41:07.960 | ./components/JoggPage/JoggInfoSection/JoggInfoSection.tsx
09:41:07.960 | 16:16 Warning: Unexpected any. Specify a different type. @typescript-eslint/no-explicit-any
09:41:07.960 |
09:41:07.960 | ./components/JoggPage/JoggPage.tsx
09:41:07.960 | 3:10 Warning: 'jsx' is defined but never used. @typescript-eslint/no-unused-vars
09:41:07.960 | 27:18 Warning: Unexpected any. Specify a different type. @typescript-eslint/no-explicit-any
09:41:07.960 | 145:48 Warning: Forbidden non-null assertion. @typescript-eslint/no-non-null-assertion
09:41:07.960 | 183:29 Warning: Unexpected any. Specify a different type. @typescript-eslint/no-explicit-any
09:41:07.961 |
09:41:07.961 | ./components/JoggReviewPage/JoggReviewPage.tsx
09:41:07.961 | 3:10 Warning: 'jsx' is defined but never used. @typescript-eslint/no-unused-vars
09:41:07.961 |
09:41:07.961 | ./components/JoggVideoAccordion/JoggVideoAccordion.tsx
09:41:07.961 | 3:10 Warning: 'jsx' is defined but never used. @typescript-eslint/no-unused-vars
09:41:07.961 | 13:15 Warning: Unexpected any. Specify a different type. @typescript-eslint/no-explicit-any
09:41:07.961 |
09:41:07.961 | ./components/JoggVideoAccordion/JoggVideoCard.tsx
09:41:07.961 | 3:10 Warning: 'jsx' is defined but never used. @typescript-eslint/no-unused-vars
09:41:07.961 |
09:41:07.961 | ./components/JoggVideoCarousel/JoggVideoCarousel.tsx
09:41:07.962 | 3:10 Warning: 'jsx' is defined but never used. @typescript-eslint/no-unused-vars
09:41:07.962 | 33:42 Warning: Unexpected any. Specify a different type. @typescript-eslint/no-explicit-any
09:41:07.962 |
09:41:07.962 | ./components/JoggVideoCarousel/JoggVideoCarouselItem.tsx
09:41:07.962 | 3:10 Warning: 'jsx' is defined but never used. @typescript-eslint/no-unused-vars
09:41:07.962 | 152:31 Warning: Unexpected any. Specify a different type. @typescript-eslint/no-explicit-any
09:41:07.962 |
09:41:07.962 | ./components/MaintenancePage/MaintenancePage.tsx
09:41:07.962 | 3:10 Warning: 'jsx' is defined but never used. @typescript-eslint/no-unused-vars
09:41:07.962 |
09:41:07.962 | ./components/ReportPageComponent/JoggReportBody.tsx
09:41:07.962 | 3:10 Warning: 'jsx' is defined but never used. @typescript-eslint/no-unused-vars
09:41:07.962 |
09:41:07.962 | ./components/ReportPageComponent/JoggReportCard.tsx
09:41:07.962 | 3:10 Warning: 'jsx' is defined but never used. @typescript-eslint/no-unused-vars
09:41:07.962 |
09:41:07.962 | ./components/ReportPageComponent/JoggReportHeader.tsx
09:41:07.962 | 3:10 Warning: 'jsx' is defined but never used. @typescript-eslint/no-unused-vars
09:41:07.962 |
09:41:07.963 | ./components/ReportPageComponent/ReportPageComponent.tsx
09:41:07.963 | 3:10 Warning: 'jsx' is defined but never used. @typescript-eslint/no-unused-vars
09:41:07.963 |
09:41:07.963 | ./components/ReportPageComponent/ReportPageError.tsx
09:41:07.963 | 3:10 Warning: 'jsx' is defined but never used. @typescript-eslint/no-unused-vars
09:41:07.963 |
09:41:07.963 | ./components/StationPage/StationErrorBoundary.tsx
09:41:07.963 | 3:10 Warning: 'jsx' is defined but never used. @typescript-eslint/no-unused-vars
09:41:07.963 | 9:12 Warning: Unexpected any. Specify a different type. @typescript-eslint/no-explicit-any
09:41:07.963 |
09:41:07.963 | ./components/StationPage/StationPage.tsx
09:41:07.963 | 3:10 Warning: 'jsx' is defined but never used. @typescript-eslint/no-unused-vars
09:41:07.964 | 62:48 Warning: Forbidden non-null assertion. @typescript-eslint/no-non-null-assertion
09:41:07.964 | 184:27 Warning: Unexpected any. Specify a different type. @typescript-eslint/no-explicit-any
09:41:07.964 | 195:33 Warning: Unexpected any. Specify a different type. @typescript-eslint/no-explicit-any
09:41:07.966 |
09:41:07.966 | ./components/SurveyQuestionPage/SurveyQuestionPage.tsx
09:41:07.966 | 3:10 Warning: 'jsx' is defined but never used. @typescript-eslint/no-unused-vars
09:41:07.966 | 27:26 Warning: Unexpected any. Specify a different type. @typescript-eslint/no-explicit-any
09:41:07.966 | 28:29 Warning: Unexpected any. Specify a different type. @typescript-eslint/no-explicit-any
09:41:07.966 | 48:34 Warning: Unexpected any. Specify a different type. @typescript-eslint/no-explicit-any
09:41:07.966 |
09:41:07.966 | ./components/UploadPage/UploadPage.tsx
09:41:07.967 | 3:10 Warning: 'jsx' is defined but never used. @typescript-eslint/no-unused-vars
09:41:07.967 | 23:34 Warning: Unexpected any. Specify a different type. @typescript-eslint/no-explicit-any
09:41:07.967 | 60:39 Warning: Unexpected any. Specify a different type. @typescript-eslint/no-explicit-any
09:41:07.967 | 73:35 Warning: Unexpected any. Specify a different type. @typescript-eslint/no-explicit-any
09:41:07.967 | 78:23 Warning: Unexpected any. Specify a different type. @typescript-eslint/no-explicit-any
09:41:07.967 | 103:38 Warning: Unexpected any. Specify a different type. @typescript-eslint/no-explicit-any
09:41:07.967 | 138:44 Warning: Unexpected any. Specify a different type. @typescript-eslint/no-explicit-any
09:41:07.967 | 150:38 Warning: Unexpected any. Specify a different type. @typescript-eslint/no-explicit-any
09:41:07.967 |
09:41:07.968 | ./components/UtilComponents/MessageModal.tsx
09:41:07.968 | 3:10 Warning: 'jsx' is defined but never used. @typescript-eslint/no-unused-vars
09:41:07.968 |
09:41:07.968 | ./components/UtilComponents/VideoLimitWarningModal.tsx
09:41:07.968 | 3:10 Warning: 'jsx' is defined but never used. @typescript-eslint/no-unused-vars
09:41:07.968 |
09:41:07.968 | ./components/VideoPlayerContainer/VideoPlayerContainer.tsx
09:41:07.968 | 3:10 Warning: 'jsx' is defined but never used. @typescript-eslint/no-unused-vars
09:41:07.968 | 17:19 Warning: Unexpected any. Specify a different type. @typescript-eslint/no-explicit-any
09:41:07.969 |
09:41:07.969 | ./components/VideoRecorder/CountDownTimer.tsx
09:41:07.969 | 3:10 Warning: 'jsx' is defined but never used. @typescript-eslint/no-unused-vars
09:41:07.969 |
09:41:07.969 | ./components/VideoRecorder/StopWatch.tsx
09:41:07.969 | 3:10 Warning: 'jsx' is defined but never used. @typescript-eslint/no-unused-vars
09:41:07.969 |
09:41:07.969 | ./components/VideoRecorder/VideoRecorder.tsx
09:41:07.969 | 8:10 Warning: 'jsx' is defined but never used. @typescript-eslint/no-unused-vars
09:41:07.969 | 19:26 Warning: Unexpected any. Specify a different type. @typescript-eslint/no-explicit-any
09:41:07.970 | 22:29 Warning: Unexpected any. Specify a different type. @typescript-eslint/no-explicit-any
09:41:07.970 | 23:24 Warning: Unexpected any. Specify a different type. @typescript-eslint/no-explicit-any
09:41:07.970 | 28:11 Warning: Unexpected any. Specify a different type. @typescript-eslint/no-explicit-any
09:41:07.970 | 308:57 Warning: Unexpected any. Specify a different type. @typescript-eslint/no-explicit-any
09:41:07.970 |
09:41:07.970 | ./lib/bugsnagClient.ts
09:41:07.970 | 18:23 Warning: Missing return type on function. @typescript-eslint/explicit-module-boundary-types
09:41:07.970 |
09:41:07.970 | ./lib/fetch.ts
09:41:07.970 | 3:52 Warning: Unexpected any. Specify a different type. @typescript-eslint/no-explicit-any
09:41:07.970 |
09:41:07.970 | info - Need to disable some ESLint rules? Learn more here: https://nextjs.org/docs/basic-features/eslint#disabling-rules
09:41:07.972 | info - Creating an optimized production build...
09:41:08.631 | info - Using external babel configuration from /vercel/path1/.babelrc
09:41:45.186 | info - Compiled successfully
09:41:45.186 | info - Collecting page data...
09:41:45.445 | [bugsnag] Loaded!
09:41:45.489 | [bugsnag] Loaded!
09:41:45.505 | [bugsnag] Loaded!
09:41:45.827 |
**09:41:45.828 | > Build error occurred
09:41:45.830 | Error: /lib64/libz.so.1: version `ZLIB_1.2.9' not found (required by /vercel/path1/node_modules/canvas/build/Release/libpng16.so.16)
09:41:45.830 | at Object.Module._extensions..node (internal/modules/cjs/loader.js:1144:18)
09:41:45.830 | at Module.load (internal/modules/cjs/loader.js:950:32)
09:41:45.830 | at Function.Module._load (internal/modules/cjs/loader.js:790:12)
09:41:45.831 | at Module.require (internal/modules/cjs/loader.js:974:19)
09:41:45.831 | at require (internal/modules/cjs/helpers.js:93:18)
09:41:45.831 | at Object.<anonymous> (/vercel/path1/node_modules/canvas/lib/bindings.js:3:18)
09:41:45.831 | at Module._compile (internal/modules/cjs/loader.js:1085:14)
09:41:45.831 | at Object.Module._extensions..js (internal/modules/cjs/loader.js:1114:10)
09:41:45.831 | at Module.load (internal/modules/cjs/loader.js:950:32)
09:41:45.832 | at Function.Module._load (internal/modules/cjs/loader.js:790:12) {
09:41:45.832 | type: 'Error',
09:41:45.832 | code: 'ERR_DLOPEN_FAILED'
09:41:45.832 | }
09:41:45.875 | npm ERR! code ELIFECYCLE
09:41:45.875 | npm ERR! errno 1
09:41:45.878 | npm ERR! consumer-web@2.3.13 build: `next build`
09:41:45.879 | npm ERR! Exit status 1
09:41:45.879 | npm ERR!
09:41:45.879 | npm ERR! Failed at the consumer-web@2.3.13 build script.
09:41:45.879 | npm ERR! This is probably not a problem with npm. There is likely additional logging output above.
09:41:45.884 |
09:41:45.885 | npm ERR! A complete log of this run can be found in:
09:41:45.885 | npm ERR! /vercel/.npm/_logs/2021-11-12T17_41_45_879Z-debug.log
09:41:45.901 | error Command failed with exit code 1.
09:41:45.901 | info Visit https://yarnpkg.com/en/docs/cli/run for documentation about this command.
09:41:45.919 | Error: Command "yarn run vercel-build" exited with 1**
I used your solution and it worked on staging build in vercel.
@jackguoAtJogg I tried to migrate my working project from npm to yarn and my serverless function doesn't works anymore (Error: /lib64/libz.so.1: version 'ZLIB_1.2.9' not found (required by /var/task/node_modules/canvas/build/Release/libpng16.so.16)
).
So can you try to move to npm? (not as a final solution, but if could help find the issue's scope, i mean, at this point… 😅)
Edit: Btw, i don't know yarn but looks like it doesn't store dependencies in node_modules but in some .yarn sub-folders. So maybe there is something to adapt with the node_modules/canvas/build/Release/
path.
@jackguoAtJogg I tried to migrate my working project from npm to yarn and my serverless function doesn't works anymore (
Error: /lib64/libz.so.1: version 'ZLIB_1.2.9' not found (required by /var/task/node_modules/canvas/build/Release/libpng16.so.16)
). So can you try to move to npm? (not as a final solution, but if could help find the issue's scope, i mean, at this point… 😅)Edit: Btw, i don't know yarn but looks like it doesn't store dependencies in node_modules but in some .yarn sub-folders. So maybe there is something to adapt with the
node_modules/canvas/build/Release/
path.
I tried and no luck, and I'm currently working with the vercel support, hopefully they'll help me solve this issue.
I'm getting a similar issue ever since i installed node-canvas-webgl
and can't seem to get it to work
Cloning github.com/BrennerSpear/token-garden-service (Branch: dev, Commit: d504fb9)
--
17:51:24.247 | Cloning completed: 2.010s
17:51:24.264 | Analyzing source code...
17:51:25.492 | Installing build runtime...
17:51:28.671 | Build runtime installed: 3.178s
17:51:31.183 | Looking up build cache...
17:51:37.664 | Build cache downloaded [180.37 MB]: 6081.922ms
17:51:38.604 | Installing dependencies...
17:51:38.854 | yarn install v1.22.17
17:51:38.876 | warning package.json: No license field
17:51:38.943 | warning birthblock-service@1.0.0: No license field
17:51:38.946 | [1/4] Resolving packages...
17:51:39.448 | [2/4] Fetching packages...
17:52:03.052 | [3/4] Linking dependencies...
17:52:03.055 | warning " > @chakra-ui/icons@1.0.16" has unmet peer dependency "@chakra-ui/system@>=1.0.0".
17:52:03.056 | warning "@chakra-ui/icons > @chakra-ui/icon@1.1.12" has unmet peer dependency "@chakra-ui/system@>=1.0.0".
17:52:03.063 | warning "@emotion/styled > @emotion/babel-plugin@11.3.0" has unmet peer dependency "@babel/core@^7.0.0".
17:52:03.064 | warning "@emotion/styled > @emotion/babel-plugin > @babel/plugin-syntax-jsx@7.14.5" has unmet peer dependency "@babel/core@^7.0.0-0".
17:52:03.064 | warning "@walletconnect/web3-provider > web3-provider-engine > eth-block-tracker > @babel/plugin-transform-runtime@7.15.8" has unmet peer dependency "@babel/core@^7.0.0-0".
17:52:03.064 | warning "@walletconnect/web3-provider > web3-provider-engine > eth-block-tracker > @babel/plugin-transform-runtime > babel-plugin-polyfill-corejs2@0.2.2" has unmet peer dependency "@babel/core@^7.0.0-0".
17:52:03.064 | warning "@walletconnect/web3-provider > web3-provider-engine > eth-block-tracker > @babel/plugin-transform-runtime > babel-plugin-polyfill-corejs3@0.2.5" has unmet peer dependency "@babel/core@^7.0.0-0".
17:52:03.065 | warning "@walletconnect/web3-provider > web3-provider-engine > eth-block-tracker > @babel/plugin-transform-runtime > babel-plugin-polyfill-regenerator@0.2.2" has unmet peer dependency "@babel/core@^7.0.0-0".
17:52:03.065 | warning "@walletconnect/web3-provider > web3-provider-engine > eth-block-tracker > @babel/plugin-transform-runtime > babel-plugin-polyfill-corejs2 > @babel/helper-define-polyfill-provider@0.2.3" has unmet peer dependency "@babel/core@^7.4.0-0".
17:52:03.068 | warning "web3modal > styled-components@5.3.3" has unmet peer dependency "react-is@>= 16.8.0".
17:52:03.069 | warning " > eslint-config-next@11.1.0" has incorrect peer dependency "eslint@^7.23.0".
17:52:03.069 | warning "eslint-config-next > @typescript-eslint/parser@4.33.0" has incorrect peer dependency "eslint@^5.0.0 \|\| ^6.0.0 \|\| ^7.0.0".
17:52:03.070 | warning "eslint-config-next > eslint-plugin-jsx-a11y@6.4.1" has incorrect peer dependency "eslint@^3 \|\| ^4 \|\| ^5 \|\| ^6 \|\| ^7".
17:52:03.070 | warning "eslint-config-next > eslint-plugin-react@7.26.1" has incorrect peer dependency "eslint@^3 \|\| ^4 \|\| ^5 \|\| ^6 \|\| ^7".
17:52:03.071 | warning "eslint-config-next > eslint-plugin-react-hooks@4.2.0" has incorrect peer dependency "eslint@^3.0.0 \|\| ^4.0.0 \|\| ^5.0.0 \|\| ^6.0.0 \|\| ^7.0.0".
17:52:18.241 | [4/4] Building fresh packages...
17:52:20.408 | error /vercel/path0/node_modules/gl: Command failed.
17:52:20.408 | Exit code: 1
17:52:20.408 | Command: prebuild-install \|\| node-gyp rebuild
17:52:20.408 | Arguments:
17:52:20.408 | Directory: /vercel/path0/node_modules/gl
17:52:20.408 | Output:
17:52:20.409 | prebuild-install WARN install /lib64/libm.so.6: version `GLIBC_2.27' not found (required by /vercel/path0/node_modules/gl/build/Release/webgl.node)
17:52:20.409 | gyp info it worked if it ends with ok
17:52:20.409 | gyp info using node-gyp@7.1.2
17:52:20.409 | gyp info using node@14.18.1 \| linux \| x64
17:52:20.409 | gyp info find Python using Python version 3.6.10 found at "/usr/local/bin/python3"
17:52:20.409 | gyp http GET https://nodejs.org/download/release/v14.18.1/node-v14.18.1-headers.tar.gz
17:52:20.409 | gyp http 200 https://nodejs.org/download/release/v14.18.1/node-v14.18.1-headers.tar.gz
17:52:20.409 | gyp http GET https://nodejs.org/download/release/v14.18.1/SHASUMS256.txt
17:52:20.409 | gyp http 200 https://nodejs.org/download/release/v14.18.1/SHASUMS256.txt
17:52:20.409 | gyp info spawn /usr/local/bin/python3
17:52:20.409 | gyp info spawn args [
17:52:20.409 | gyp info spawn args '/vercel/path0/node_modules/node-gyp/gyp/gyp_main.py',
17:52:20.409 | gyp info spawn args 'binding.gyp',
17:52:20.409 | gyp info spawn args '-f',
17:52:20.409 | gyp info spawn args 'make',
17:52:20.410 | gyp info spawn args '-I',
17:52:20.410 | gyp info spawn args '/vercel/path0/node_modules/gl/build/config.gypi',
17:52:20.410 | gyp info spawn args '-I',
17:52:20.410 | gyp info spawn args '/vercel/path0/node_modules/node-gyp/addon.gypi',
17:52:20.410 | gyp info spawn args '-I',
17:52:20.410 | gyp info spawn args '/vercel/.cache/node-gyp/14.18.1/include/node/common.gypi',
17:52:20.410 | gyp info spawn args '-Dlibrary=shared_library',
17:52:20.410 | gyp info spawn args '-Dvisibility=default',
17:52:20.410 | gyp info spawn args '-Dnode_root_dir=/vercel/.cache/node-gyp/14.18.1',
17:52:20.410 | gyp info spawn args '-Dnode_gyp_dir=/vercel/path0/node_modules/node-gyp',
17:52:20.410 | gyp info spawn args '-Dnode_lib_file=/vercel/.cache/node-gyp/14.18.1/<(target_arch)/node.lib',
17:52:20.410 | gyp info spawn args '-Dmodule_root_dir=/vercel/path0/node_modules/gl',
17:52:20.410 | gyp info spawn args '-Dnode_engine=v8',
17:52:20.410 | gyp info spawn args '--depth=.',
17:52:20.410 | gyp info spawn args '--no-parallel',
17:52:20.410 | gyp info spawn args '--generator-output',
17:52:20.410 | gyp info spawn args 'build',
17:52:20.410 | gyp info spawn args '-Goutput_dir=.'
17:52:20.410 | gyp info spawn args ]
17:52:20.410 | Package xi was not found in the pkg-config search path.
17:52:20.411 | Perhaps you should add the directory containing `xi.pc'
17:52:20.411 | to the PKG_CONFIG_PATH environment variable
17:52:20.411 | No package 'xi' found
17:52:20.411 | gyp: Call to 'pkg-config --libs-only-L --libs-only-other x11 xi xext' returned exit status 1 while in angle/src/angle.gyp. while loading dependencies of binding.gyp while trying to load binding.gyp
17:52:20.411 | gyp ERR! configure error
17:52:20.411 | gyp ERR! stack Error: `gyp` failed with exit code: 1
17:52:20.411 | gyp ERR! stack at ChildProcess.onCpExit (/vercel/path0/node_modules/node-gyp/lib/configure.js:351:16)
17:52:20.411 | gyp ERR! stack at ChildProcess.emit (events.js:400:28)
17:52:20.412 | gyp ERR! stack at Process.ChildProcess._handle.onexit (internal/child_process.js:282:12)
17:52:20.412 | gyp ERR! System Linux 4.14.248-189.473.amzn2.x86_64
17:52:20.412 | gyp ERR! command "/node14/bin/node" "/vercel/path0/node_modules/gl/node_modules/.bin/node-gyp" "rebuild"
17:52:20.412 | gyp ERR! cwd /vercel/path0/node_modules/gl
17:52:20.412 | gyp ERR! node -v v14.18.1
17:52:20.412 | gyp ERR! node-gyp -v v7.1.2
17:52:20.412 | gyp ERR! not ok
17:52:20.412 | info Visit https://yarnpkg.com/en/docs/cli/install for documentation about this command.
17:52:20.449 | Error: Command "yarn install" exited with 1
I've tried
"vercel-build": "yum install libuuid-devel libmount-devel wget && cp /lib64/{libuuid,libmount,libblkid}.so.1 node_modules/canvas/build/Release/ && ./setup.sh && yarn run build"
but it seems like it's failing even before getting to the build command, failing when it runs yarn install
... Am i having a completely different error or am I not adding the build step with the setup.sh
correctly?
@BrennerSpear You should try including the yum command in the Install Command instead of in a script →
https://vercel.com/docs/concepts/deployments/build-step#build-image
As an alternative to node-canvas
, try @napi-rs/canvas
which has a lot of the same features.
Thanks to @Brooooooklyn
Switched to just rendering on the frontend and using urlbox.io :)
On Tue, Dec 14, 2021 at 3:47 PM Steven @.***> wrote:
As an alternative to node-canvas, try @napi-rs/canvas @.***/canvas> which has a lot of the same features
— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub https://github.com/vercel/vercel/issues/3460#issuecomment-994061204, or unsubscribe https://github.com/notifications/unsubscribe-auth/AC4Q26NZNK3CCYJJD2T45PLUQ63NPANCNFSM4J6QFO4A .
Checkout the demo of @napi-rs/canvas
on Vercel, without any configuration: https://github.com/Brooooooklyn/vercel-canvas/blob/main/api/canvas.js
I’m currently using canvaskit-wasm package as an alternative. It’s published by Google. Although its Canvas2D Emulation Layer has some limitations, it works out-of-the-box.
I found a solution through this issue: https://github.com/Automattic/node-canvas/issues/1779#issuecomment-896125623.
Adding this to top of your next.config.js and deploy should work!
if (
process.env.LD_LIBRARY_PATH == null ||
!process.env.LD_LIBRARY_PATH.includes(
`${process.env.PWD}/node_modules/canvas/build/Release:`,
)
) {
process.env.LD_LIBRARY_PATH = `${
process.env.PWD
}/node_modules/canvas/build/Release:${process.env.LD_LIBRARY_PATH || ''}`;
}
Actually this solution only works in client rendering, if you're trying to use SSR this solution won't work for you.
@Brooooooklyn @napi-rs/canvas is also giving errors:
2022-06-23T02:39:59.145Z undefined ERROR Error: /lib64/libm.so.6: version `GLIBC_2.27' not found (required by /var/task/node_modules/@napi-rs/canvas-linux-x64-gnu/skia.linux-x64-gnu.node)
at Object.Module._extensions..node (internal/modules/cjs/loader.js:1144:18)
at Module.load (internal/modules/cjs/loader.js:950:32)
at Function.Module._load (internal/modules/cjs/loader.js:790:12)
at Module.require (internal/modules/cjs/loader.js:974:19)
at require (internal/modules/cjs/helpers.js:101:18)
at Object.<anonymous> (/var/task/node_modules/@napi-rs/canvas/js-binding.js:138:31)
at Module._compile (internal/modules/cjs/loader.js:1085:14)
at Object.Module._extensions..js (internal/modules/cjs/loader.js:1114:10)
at Module.load (internal/modules/cjs/loader.js:950:32)
at Function.Module._load (internal/modules/cjs/loader.js:790:12) {
code: 'ERR_DLOPEN_FAILED'
}
Hi 👋 , I'm having a runtime error with my app that uses
node-canvas@2.6.0
. It doesn't uses it directly, but through the packagetext2png@2.3.0
. Here is the error I gotAs far I know, right now AWS Lambda functions doesn't include the necessary libraries to work correctly with this package. This is describe in node-canvas#1448 and now I'm wondering if there is a work around in
now
to this issue.