getPayload
tries to deal with email even outside Next.js
#10046
Labels
getPayload
tries to deal with email even outside Next.js
#10046
Describe the Bug
I reported some time ago about a problem when using
getPayload
method outside of Next.js generating importMap outside Next.js when it was not needed and it was actually causing problems. This issue was kindly fixed by @r1tsuu but this didn't resolve the other issue I had which is that when I'm invokinggetPayload
method outside Next.js, it's trying to deal with some email stuff from mypayload.config.ts
that I'm importing.Of course this is not needed at all when we just want to consume the Local API and generates errors in the console of the application that's consuming the Local API. Here is a sample log from my app :
In a more general way, it seems like when we use Payload from outside Next.js, it's trying to do way more things that we'd like to, especially when you just want to consume the Local API. (e.g Sentry stuff).
I don't know if something can be done to opt-out some plugins to be used only in Payload for example.
Link to the code that reproduces this issue
https://github.com/fofoy/payload-getPayload-outside-nextjs
Reproduction Steps
1 - Clone repo
2 - Run command
pnpm install
3 - Run command
docker run -d --name payload-monorepo -p 27017:27017 mongo
to spin up a new MongoDB instance4 - Run command
pnpm run dev
to start the apps in the monorepo5 - Go to the next application URL, it should be
http://localhost:3001
6 - Check out
next#dev
task and you should see following logs about email adapter not being providedand also Sentry logs
Which area(s) are affected? (Select all that apply)
area: core, email-nodemailer, plugin: sentry
Environment Info
The text was updated successfully, but these errors were encountered: