Im having an issue with using Supertokens in cust...
# support-questions-legacy
j
Im having an issue with using Supertokens in custom nodejs project. I get the following error ERR_UNSUPPORTED_DIR_IMPORT when I try the following
Copy code
js
// Super Tokens Library
import supertokens from "supertokens-node";
import Session from "supertokens-node/recipe/session";
import EmailPassword from "supertokens-node/recipe/emailpassword";
import { errorHandler, middleware } from "supertokens-node/framework/express";
// Express Library
import express from "express";
// Cors Library
import cors from "cors";
// SuperToken Configurations
import { getWebsiteDomain, superTokensConfig } from "./config";
r
hey @jordz2203 whats the full stack trace?
j
Will post now, I have added "type": "module", to my package.json because in the docs for SuperTokens it uses import but you need to specify import in it.
r
you can use require instead
i don't think type: module is the correct thing to do
j
oh okay, I will use require instead its better for me
6 Views