Dynamic Imports Failed at times, Screen becomes black

Hi Everyone,

We have deployed our website on production & there is traffic also we are experiencing.

Some of the users are sharing black screen issues when they open the website. Sharing the screenshot of the same. Please let me know how can this be handled.

Not a problem at the server also. Clearing cache works fine on browser

I canā€™t tell if thatā€™s related, but there is an issue in the latest Safari browser. But it is possible to fix it in meteor as well. Check this issue.

1 Like

We have Blaze in the front end. Any Suggestions regarding that?

If the issue is only related to Safari browser, try to initiate a dummy IDB in your main.js file. Thatā€™s the simplest workaround.

indexedDB.open('dummy')

The issue is with chrome, not sure about safari.

Will try this thanks, is there any way we can catch this error & reload the page somehow along with clearing the cache?

Will that work? Or is this solved in latest meteor version?

@storyteller can you please share your inputs, is this solved in the latest blaze version?

@filipenevola please check this

Are you using a CDN?

Yes, is it causing the issue? @storyteller

@storyteller please share youd inputs, we need help. Canā€™t figure out the issue & the solution for this.

Make sure that your CDN has the latest version of your app and maybe purging the caches there once in a while is a good idea. Another thing that comes to mind is if you are using web worker, beyond that I would need some sort of a reproduction. I have gotten rarely this error in development where refreshing would fix it.

We keep deploying builds on production, Since the development is also going on on other modules. We are using docker to create images.

No web workers are being used.

Is there any way we can catch this error & make the page reload on its own, will it work?

Or Updating the meteor version, we are using 2.0 currently.

First try updating to Meteor 2.2 if you can.

Have you seen the error logs for the 502 error that the server is throwing? That will give you additional ideas on what and where to fix your error

1 Like

Yes, Application Crashed & the final Logs

contains

terminate called after throwing an instance of ā€˜std::bad_allocā€™
Jun 22 05:30:12 ip-10-6-1-194.ap-south-1.compute.internal 39fe5d5b2491[2749]: what(): std::bad_alloc

have changed the docker file this this CMD node --expose-gc --max-old-space-size=3072 main.js

added --expose-gc --max-old-space-size=3072

Any Suggestion on this?

Seems like this problem is an ā€œout of memoryā€ problem. Does your server have enough RAM?

We have 4 GB RAM but still its crashing

This is definitely server/DevOps issue. Something fills entire memory (memory available to node.js process)

Was just writing into this: Is there a way to serve Html and dynamic imports from CDN? - #11 by paulishca. Please take a look at this image.

This is before I put back dynamic imports into static (back into the JS bundle). As I get my main bundle from CDN (AWS Cloudfront), ~800k get to me from Frankfurt (or wherever because of the Cloudfront diversity) to Dubai in 145ms. You can see the speed per various sizes I get from my EBS (with elastic app network balancer) with EC-2 for the split code. This project has no users at the moment, itā€™s a WIP. In your case, with many users you challenge the infrastructure in multiple points (server memory, server bandwidth, NGINX (or balancer) bandwidth, network interface(s) bandwidth.
Iā€™d delete my local IndexdDB in the browser and have look at the performance in delivery of all those fetches.