Uncaught (in promise) ReferenceError: process is not defined when calling createRxDatabase

I just asked this over at Stackoverflow (javascript - Uncaught (in promise) ReferenceError: process is not defined when calling createRxDatabase in aurelia app - Stack Overflow) but hopefully have better chances to receive an answer here…

I am trying to use rxdb as a store for my aurelia app. I have not found a plugin that implements this aleady, so start writing my own solution. I am using aurelia-cli 2.0.3, aurelia-loader-nodejs 1.1.0 and aurelia-webpack-plugin 5.0.3 with rxdb 11.3.0.

The problem I am running into is that as soon as I call createRxDatabase I get the error “Uncaught (in promise) ReferenceError: process is not defined” in the browser console. I tried to follow the recipe given in javascript - Uncaught ReferenceError: process is not defined - Stack Overflow but this result in the following webpack-dev-server warning: “DefinePlugin: Conflicting values for ‘process.env.NODE_ENV’”

Any clues how I can please rxdb?

What webpack version are you on?
(probably webpack5 if you created that aurelia-cli project “recently”)

If yes, webpack5 does not polyfill process (compared to webpack4)
To v5 from v4 | webpack → search for “process is not defined”.

I had to solve this as well, maybe you can get inspiration from:

1 Like

Any further details of what to look for this particular issue?

Are you encountering the same error?
And the PR I linked didn’t helped you?

It ultimately did, I had other issues still and didn’t come back here to update this. Thanks

1 Like