Can't take screenshot with emoji on Firebase Cloud Functions
See original GitHub issueSteps to reproduce
Tell us about your environment:
- Puppeteer version: 1.12.2
- Platform / OS version: Firebase
- URLs (if applicable):
- Node.js version: 8
What steps will reproduce the problem? ` import * as functions from ‘firebase-functions’; import * as admin from ‘firebase-admin’; admin.initializeApp(); const storage = admin.storage(); const puppeteer = require(‘puppeteer’);
function screenshot() {
(async () => {
const browser = await puppeteer.launch({ headless: true, args: ['--no-sandbox', '--disable-setuid-sandbox'] });
const page = await browser.newPage();
await page.goto("https://getemoji.com/"); //go to emoji page
await page.screenshot({
path: '/tmp/screenshot.png',
omitBackground: true,
})
.then(() => {
// upload screenshot to firebase storage
storage.bucket('bucketName').upload('/tmp/screenshot.png')
.then(() => {
console.log("success");
})
.catch(error => {
console.log(error);
});
})
.catch(e => {
console.log(e);
});
})();
}
`
- create HTTP Cloud Function
- call the screenshot function inside of the HTTP function
What is the expected result? screenshot.png is uploaded to storage, and can see emoji clearly in the image
What happens instead? screenshot.png is uploaded to storage, but can’t see emoji in the image.
here is the result screenshot of “https://getemoji.com/”:
Issue Analytics
- State:
- Created 5 years ago
- Reactions:10
- Comments:15 (3 by maintainers)
Top Results From Across the Web
Firebase Cloud Functions + Puppeteer can't take screenshot ...
I'm trying to take screenshot of a page with emoji by puppeteer on Firebase Cloud Functions, but emoji doesn't show up correctly in...
Read more >Robo scripts reference guide | Firebase Test Lab - Google
This document provides reference information about Robo scripts including structure, capabilities, usage, recording, and actions. Robo scripts are tests ...
Read more >3 Firebase services in a simple Android app | by Rahul Pandey
It's fun to see the “story” created by other users in the app and try to interpret what their emoji means. The app...
Read more >Building a realtime chat application using WebSockets with ...
A step by step guide to building a realtime chat app using WebSockets with Angular and Firebase - plus alternative approaches to consider....
Read more >Authentication - Expo Documentation
You cannot use the Expo proxy ( useProxy ) because they don't allow @ in their redirect ... For educational purposes only: function...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
I had the same issue Puppeteer/headless Chrome rendering emojis as □□□□
For those that are looking for a workaround, here is what worked for me, copy the font file in the local fonts folder:
Hope this helps if anybody has the same issue
@steren surprisingly, I don’t have permissions to create new issue.
But the font identifies itself as “Noto Emoji” for me on Linux. I’d guess installing both https://github.com/googlei18n/noto-emoji and https://github.com/googlei18n/noto-fonts should cover all the needs.