protobuf.js version: 6.8.8
Ubuntu: 19.04
Node: 12.2.0
Angular: 7.2.15 with server-side rendering enabled
I'm seeing "Error: not supported" popping up in an Angular 7 app on Node 12.2.0. Just upgraded Node from 10.15.3, where it did not have the error.

After a little digging, it looks like this references _/src/root.js_:233-234:

and _/src/util/minimal.js_:55:

After commenting out the check in root.js, everything seems to work fine. Is there another solution?
The check is here: https://github.com/protobufjs/protobuf.js/blob/master/src/util/minimal.js#L55
There might be something in your stack invalidating it, or did node change something? Workaround:
protobuf.util.isNode = true; // or your own check
...
I think it might be related to Angular's server-side rendering. The util object captures global.document but not global.process, which could make sense for SSR:

I'm having a similar, so what I found worked (which I don't think would be a hard/serious change) is in src/util/minimal.js I reordered the util.global. It was:
util.global = typeof window !== "undefined" && window
|| typeof global !== "undefined" && global
|| typeof self !== "undefined" && self
|| this; // eslint-disable-line no-invalid-this
And I swapped it to this:
util.global = typeof global !== "undefined" && global
|| typeof window !== "undefined" && window
|| typeof self !== "undefined" && self
|| this; // eslint-disable-line no-invalid-this
I'm using mocha with jsdom so the window object is passing first and therefore being set as the global, not the NodeJS.Global! But if I swap the order it works fine. Could this be implemented into the regular library?
Hmm, good question. The old order assumes that a global window is super unlikely inside of a node module because there isn't an implicit global scope one could accidentally declare such a variable in, while the new depends on the assumption that no dev would ever define a global var named global in a browser context, which is unlikely.
I believe this may be a conflict with NestJS people use a lot for SSR:
https://github.com/nestjs/ng-universal/blob/master/lib/utils/domino.utils.ts
If protobuf.js is initialized first, there is no error with isNode mode detection.
That makes sense.
It's also an issue if you are using jsdom with mocha.
EDIT: wrote an article about how I fixed this with angular SSR: https://medium.com/@michele.patrassi/angular-ssr-firebase-save-days-of-debugging-by-reading-these-fixes-fcb060e248bb
OLD
same, I had this with the latest version of firebase (currently 6.4.0). I needed to downgrade to "^5.9.1" to still have SSR working.
There are some valid comments up in the thread: what's the best way to approach this?
Most helpful comment
It's also an issue if you are using
jsdomwithmocha.