Open dev-rish opened 6 months ago
I have a project that already uses common js. I am trying to implement auth via credentials. When I import like so
const AuthPlugin = require("fastify-next-auth"); const CredentialsProvider = require("@auth/core/providers/credentials");
I get the following error
node:internal/modules/cjs/loader:488 throw e; ^ Error [ERR_PACKAGE_PATH_NOT_EXPORTED]: No "exports" main defined in D:\Projects\mapsted-admin\node_modules\@auth\core\package.json
Lib Versions
"@auth/core": "^0.26.2" "fastify": "^4.24.3" "fastify-next-auth": "^0.7.0"
Any way to fix it without updating the package.json to have "type": "module"?
package.json
"type": "module"
I have a project that already uses common js. I am trying to implement auth via credentials. When I import like so
I get the following error
Lib Versions
Any way to fix it without updating the
package.json
to have"type": "module"
?