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 }
[...]/node_modules/atlassian-connect-express/node_modules/sequelize/lib/sequelize.js:189
      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?

1 Like