RegEx Error in deployment (as build): Invalid regular expression: /^/(/sockjs[/]?$/: Unterminated group

I’m deploying a build to an Ubuntu 14.04 server (on DigitalOcean) (architecture = os.linux.x86_64)

Our setup is using Nginx and Phusion Passenger to run the meteor application (as a Node app).
When accessing the website, I get the following error:

SyntaxError: Invalid regular expression: /^/(/sockjs[/]?$/: Unterminated group
at new RegExp (<anonymous>)
at /
at generate_dispatcher (/programs/server/npm/ddp-server/node_modules/sockjs/lib/sockjs.js:121:27)
at new Listener (/
at Server.listener (//programs/server/npm/ddp-server/node_modules/sockjs/lib/sockjs.js:191:14)
at Server.installHandlers (/
at new StreamServer (stream_server.js:81:15)
at new Server (livedata_server.js:1327:24)
at Package (server_convenience.js:6:17)
at /*/programs/server/packages/ddp-server.js:2136:4


Anyone any ideas on how to fix this?
Ofcourse I can see it’s an invalid RegEx, but it’s also core code, which we have not touched.

Could be another issue, like incorrect node version. Also have you tried to rebuild fibers on the machine?

Running Node v 0.12.2 (both on the place where the app is build as on the server).
Have reinstalled fibers.
Still the same error.
But it looks like an error in the code, as I can see the regex is wrong: /^/(/sockjs[/]?$/ should be something like: /^/(/sockjs[/]?)$/ or /^/(/sockjs)[/]?$/

Can you try switching to v0.10.40 first? (or v0.10.36 if using Meteor <1.2)

I’m running the latest meteor version.
Switched to v0.10.40, still same error.
Actually I switched to v0.12.2 because of this error, thought it might make a difference.

But I don’t know how the node version can influence the construct of a Regexp within javascript, especially in this matter. I would consider that bad coding, but I think it’s a bug. Only thing that’s weird is that it seems I’m the only one having this problem.

I know what you’re saying, but I’ve experienced similar errors which were due to the wrong node version :slight_smile: Thought it was worth suggesting.