Cannot add "realm" dependency to https endpoint

I need to confirm my new users by clicking a link sent by a realm email. I want this link to be a realm https endpoint, where i define a function to confirm the user, using the confirmUser method. However, i cannot add the realm dependency to the function, i am getting this error:

Failed to install dependencies failed to transpile node_modules/node-machine-id/index.js. "node-machine-id" is likely not supported yet. unknown: Missing initializer in destructuring declaration. (5:14)