Atlassian-Connect hello-world app in prod: Cannot read property 'replace' of null

I’ve checked out the hello world app and now I want to try to run it in production for a test-run. When setting export NODE_ENV=production and running the app, I get the following error:

$ node app.js
{ logging: [Function (anonymous)], pool: undefined }
      options.dialect = urlParts.protocol.replace(/:$/, '');

TypeError: Cannot read property 'replace' of null

Starting in development mode works fine. Any idea why this happens? I’ve tried with node 10, 12 and 14. Do I have to do anything else for it to be able to run in production?

Also, how do I change the {{localBaseUrl}} that is used within atlassian-connect.json, without having to alter the file itself? I’d like to keep the same file for development and production.

This is exactly what the config.json file is for. You specify the localBaseUrl in the development and the production object and the correct value will be used depending on which env you have set.

For the frist error, have you filled your store values with the correct connection string in the “config.json” file?


Hi Kilian, I have the same problem but I already checked the config.json file and I have the url I use in production.

Could you support me with that