Monday 1 May 2017

Figuring what's wrong in my SSR bundle

I'm doing server-side rendering of my vue.js app, throught a bundle generated by webpack.

Most part of it is working fine. I've got no error when I access the client-side page.

I don't have any critical error on server-side too, except that I've got an annoying warning when I execute the bundleRenderer.renderToStream function. It is the following:

(node:4548) UnhandledPromiseRejectionWarning: Unhandled promise rejection (rejection id: 1): TypeError: str.replace is not a function
(node:4548) DeprecationWarning: Unhandled promise rejections are deprecated. In the future, promise rejections that are not handled will term
inate the Node.js process with a non-zero exit code.

This (non-critical, cause everything is actually working fine) error seems to be located in my ssr-bundle.json (generated by vue-ssr-webpack-plugin). The problem is that this file is heavy and mostly unreadable.

Additionaly, after an extensive research, the error won't show if I don't router.push(context.url) on bootstrap (but it appears whatever the address is, so it's not component related).

I tried to put some try/catch in different locations, and see if there is a promise somewhere I missed but without success.

So I would like to have a suggestion on a way to figure where my problem is, like a real trace of my server-side execution, or a way to handle this annoying promise.



via Cobaltway

No comments:

Post a Comment