https://supertokens.com/ logo
Title
p

productdevbook

12/15/2022, 5:34 AM
supertokens-node/recipe/session dont support esm ?
Since the structure is completely built on esm, it is currently giving an error in the session
n

nkshah2

12/15/2022, 5:36 AM
Can I see the error?
p

productdevbook

12/15/2022, 5:36 AM
node_modules/ts-node/dist-raw/node-internal-modules-esm-resolve.js:362 const err = new ERR_UNSUPPORTED_DIR_IMPORT(path, fileURLToPath(base)); /node_modules/supertokens-node/recipe/session CustomError: ERR_UNSUPPORTED_DIR_IMPORT
n

nkshah2

12/15/2022, 5:36 AM
And what line is this complaining for?
p

productdevbook

12/15/2022, 5:37 AM
it doesn't show it
n

nkshah2

12/15/2022, 5:39 AM
Is this complaining locally or when deploying on some platform?
p

productdevbook

12/15/2022, 5:41 AM
local
ts-node --esm --swc --transpile-only ./index.ts
n

nkshah2

12/15/2022, 5:42 AM
Can you include this flag and see if that resolves it
--experimental-specifier-resolution=node
p

productdevbook

12/15/2022, 6:19 AM
no all diffrent packages error because only esm used
n

nkshah2

12/15/2022, 6:21 AM
Hmm I would recommend opening an issue about this for supertokens-node and we can take a look at it, please include information like the version of typescript and ts-node you are using so that we can test for this better
n

nkshah2

12/16/2022, 4:55 AM
Thanks, well take a look
this is problem
import Session from 'supertokens-node/recipe/session/index.js'
and fixed
n

nkshah2

12/19/2022, 5:00 AM
The issue stems from that the SDK imports for example
/recipe/session
which would normally auto resolve to
/recipe/session/index.js
but isnt. We are evaluating this
p

productdevbook

12/19/2022, 5:23 AM
hmm okay reopen issua