Closed vtonchev closed 8 months ago
The error message says it all. You can either add "type": "module"
, or rename the file to .mts
.
Auth.js libraries are distributed as ESM-only.
You can reach out to zenstack, maybe they might consider switching to ESM too (recommended), or at least publish an ESM version as well:
Environment
System: OS: macOS 14.2.1 CPU: (8) arm64 Apple M2 Memory: 109.30 MB / 16.00 GB Shell: 5.9 - /bin/zsh Binaries: Node: 20.11.0 - ~/.nvm/versions/node/v20.11.0/bin/node Yarn: 1.22.21 - ~/.npm-global/bin/yarn npm: 10.2.4 - ~/.nvm/versions/node/v20.11.0/bin/npm Browsers: Chrome: 121.0.6167.85 Safari: 17.2.1 npmPackages: @auth/express: ^0.4.0 => 0.4.0 next-auth: ^4.24.5 => 4.24.5
Reproduction URL
https://github.com/vtonchev/Reproducing--auth-express-error/tree/master
Describe the issue
I recieve the following error:
I do not want to add field `"type": "module" inside package.json, because It create more error with other packages (ZenStackMiddleware).
How to reproduce
Just clone the repo and compile ts with command: tsc After that run the js file in dist folder: node {}Project_Dir}/dist/index.js
Expected behavior
everything to run correctly