'Getting error while accessing api after uploading it to heroku, but works fine locally
when I try to access my API uploaded on Heroku, I'm getting this error when I hit from the postman.
Did anyone have the same error?
When I run it locally, it works fine but if I access it after uploading it to Heroku I'm getting the following error.
[{"status":"ErrorError: Failed to launch the browser
process!\n/app/node_modules/puppeteer/.local-chromium/linux-818858/chrome-linux/chrome: error while loading shared
libraries: libnss3.so: cannot open shared object file: No such file or directory\n\n\nTROUBLESHOOTING:
https://github.com/puppeteer/puppeteer/blob/main/docs/troubleshooting.md\n"}]
here is my index.js code
import express from 'express';
import serviceRoutes from './routes/running.js';
const app = express();
const PORT = 5000;
//
app.use(express.json({limit: '50mb'}));
app.use(express.urlencoded({limit: '50mb'}));
// routing
app.use('/service', serviceRoutes);
app.get('/',(req, res)=>{
console.log('GET');
res.sendFile('serviceRunning.html',{root: './html files'});
});
app.listen(process.env.PORT || 5000, () =>{
console.log(`SERVER RUNNING ON PORT: http://localhost:${PORT}`);
});
here is my Github repo link: https://github.com/shivamkapasia0/Doc2PDF_API
I'm a newbie to nodejs so any help will be appreciated.
Sources
This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.
Source: Stack Overflow
| Solution | Source |
|---|
