https://supertokens.com/ logo
Title
e

eugene

10/20/2022, 8:50 PM
I have a problem when using SuperTokens on express:
/Users/eugenechan/Desktop/one-click-dao-builder/backend/node_modules/supertokens-node/lib/build/supertokens.js:347
                      .split(";")
                       ^

TypeError: Cannot read properties of undefined (reading 'split')
has anyone faced this problem before?
r

rp

10/21/2022, 3:17 AM
Hey! What’s the supertokens.init that you have given?
e

eugene

10/21/2022, 3:18 AM
SuperTokens.init({
  framework: "express",
  supertokens: {
      // https://try.supertokens.com is for demo purposes. Replace this with the address of your core instance (sign up on supertokens.com), or self host a core.
      connectionURI: process.env.SUPERTOKEN_CONNECT_URI,
      apiKey: process.env.SUPETOKEN_CONNECT_KEY,
      // apiKey: "IF YOU HAVE AN API KEY FOR THE CORE, ADD IT HERE",
  },
  appInfo: {
      // learn more about this on https://supertokens.com/docs/session/appinfo
      appName: "One click DAO builder",
      apiDomain: "http://localhost:8000",
      websiteDomain: "http://localhost:3000",
      apiBasePath: "/auth",
      websiteBasePath: "/auth",
  },
  recipeList: [
      Session.init()
  ]
});
r

rp

10/21/2022, 3:19 AM
Is the value of process.env.CONNECTION_URI properly set? Can you console log it before calling the init function?
e

eugene

10/21/2022, 3:39 AM
you are right; its undefined
ok perfect it works now!
thanks!!
r

rp

10/21/2022, 3:54 AM
Great!