Comments (11)
We decided that embedding a browser is not a sustainable solution.
So we built an alternative solution to convert HTML/CSS to PNG.
Check out https://vercel.com/blog/introducing-vercel-og-image-generation-fast-dynamic-social-card-images
from og-image.
@styfle Both the linked issue and discussion continue after being marked as resolved and contain the example repo that fails (updated after the patch was released)
For example vercel/vercel#4013 (comment) and its follow up comment vercel/vercel#4013 (comment)
This is the exact issue I am receiving.
from og-image.
@styfle Indeed that comment is out of place for this repo, but it would be greatly appreciated if you could take your time to answer some of the questions in the linked issue.
It appears that Vercel imposes a combined 50mb issue on all NextJS /pages/api
functions, but allows a 50mb individual limit for functions in /api
. This seems counter intuitive to the Vercel limits documentation as @next/bundle-analyzer
reports /pages/api
as individual functions.
For example if you have three functions that compile to 45mb, 5mb, 2mb. If using NextJS you will not be able to deploy onto Vercel, however this will work for non-NextJS projects.
Also just to clarify this is not a puppeteer issue, you could have a lambda function that reads 45mb JSON file and get the same issue.
I hope that explains @JavierMartinz's intent and again it would be awesome if you could take the time to post a clarifying response in the linked issue. There is also this discussion thread
from og-image.
I've put together a table, plus there's a Wiki test suite with more detailed edge cases for further comparison: https://commons.wikimedia.org/wiki/User:JoKalliauer/SVG_test_suites/resvg_Issues_details
Engine & binding | resvg & resvg-js | sharp & librsvg | skia & skr-canvas |
---|---|---|---|
language | Rust | Rust/C++ | Rust/C++ |
Features | Lightweight and fast. SVG1.1 best compatibility | Full CSS3 selector support, <text> support is poor |
Less support for SVG and CSS selectors |
resvg(resvg-js) and librsvg(sharp) each have their own strengths, with librsvg being a bit faster with new features and bug fixes after migrating to Rust, but no crate has been released yet. resvg-js can easily achieve dual-engine rendering in the future, thanks to napi-rs's good architecture, to complement each other.
from og-image.
@jongold we're testing a few approaches right now! Check out the latest pulls https://github.com/vercel/og-image/pulls
from og-image.
I'm having this problem too and I cannot deploy it to Vercel. I saw here that a workaround would be moving the JS from pages/api/
to api/
, but in that case the URL wouldn't be reachable anymore.
from og-image.
in that case the URL wouldn't be reachable anymore
What does that mean?
Using api/
is how this repo works as seen here: https://og-image.vercel.app
Have you tried cloning this repo and using the same dependency version from package.json
?
from og-image.
@marklawlor The linked issues were fixed so perhaps you are hitting a different corner case.
If you could create a new issue with an example repo that fails, then we can take a look, thanks!
from og-image.
+1 - I love the approach of this repo but running into these issues getting it running in Next.js on Vercel
from og-image.
You can also give node-canvas a try
from og-image.
hi, you can use miniblink: https://github.com/weolar/miniblink49
from og-image.
Related Issues (20)
- Would you consider allowing the first image to be custom ? HOT 2
- How much does it cost to host on vercel HOT 3
- Does this generate images on each request HOT 4
- Koyeb hosting support
- trying to run my own as written in the readme HOT 1
- serverless function exceeds maximum size limit of 50mb HOT 4
- Can't start dev server in freshly forked repo HOT 4
- UI doesn't work, outputs code instead. HOT 4
- Issue deploying to Vercel on `Hobby` and `Team` plan HOT 1
- The engine "node" is incompatible with this module. Expected version "14.x" HOT 2
- Update to new `Next.js` logo 🎉 HOT 2
- Announcing Vercel OG HOT 26
- (opened in error) apologies
- OG image is not working on twitter HOT 1
- Can't resolve custom fonts when deploying at Vercel HOT 1
- Twitter image needs to be one word HOT 2
- How to return a 401 error on one endpoint of these? HOT 2
- How to call the database from a vercel OG endpoint? Is it possible? HOT 1
- Error: Can't load image x: Failed to parse URL from x HOT 1
- Deploying to Netlify HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from og-image.