Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Is Prisma a requirement? #491

Open
wollardj opened this issue Dec 10, 2023 · 1 comment
Open

Is Prisma a requirement? #491

wollardj opened this issue Dec 10, 2023 · 1 comment

Comments

@wollardj
Copy link

wollardj commented Dec 10, 2023

Describe the bug
I enjoy using Prisma, but the Remix project I'm currently working on doesn't make use of it. This is the error encountered when trying to send an email:

 ✓ Compiled /api/sendMail in 90ms (380 modules)
 ⨯ PrismaClientInitializationError: Your schema.prisma could not be found, and we detected that you are using Next.js.
Full stack trace
 ✓ Compiled /api/sendMail in 90ms (380 modules)
 ⨯ PrismaClientInitializationError: Your schema.prisma could not be found, and we detected that you are using Next.js.
Find out why and learn how to fix this: https://pris.ly/d/schema-not-found-nextjs
    at constructor (webpack://mailing/prisma/generated/client/runtime/library.js?c464:106:2362)
    at getEngine (webpack://mailing/prisma/generated/client/runtime/library.js?c464:177:6135)
    at constructor (webpack://mailing/prisma/generated/client/runtime/library.js?c464:177:5719)
    at eval (webpack://mailing/prisma/index.ts?a5ca:8:43)
    at Module.(api)/./prisma/index.ts (/redacted/path/.mailing/.next/server/pages/api/sendMail.js:372:1)
    at __webpack_require__ (/redacted/path/.mailing/.next/server/webpack-api-runtime.js:33:43)
    at eval (webpack-internal:///(api)/./src/util/validate/validateApiKey.ts:6:65)
    at Module.(api)/./src/util/validate/validateApiKey.ts (/redacted/path/.mailing/.next/server/pages/api/sendMail.js:442:1)
    at __webpack_require__ (/redacted/path/.mailing/.next/server/webpack-api-runtime.js:33:43)
    at eval (webpack-internal:///(api)/./src/pages/api/sendMail.ts:7:87)
    at Module.(api)/./src/pages/api/sendMail.ts (/redacted/path/.mailing/.next/server/pages/api/sendMail.js:392:1)
    at __webpack_require__ (/redacted/path/.mailing/.next/server/webpack-api-runtime.js:33:43)
    at eval (webpack-internal:///(api)/../node_modules/next/dist/build/webpack/loaders/next-route-loader/index.js?kind=PAGES_API&page=%2Fapi%2FsendMail&preferredRegion=&absolutePagePath=.%2Fsrc%2Fpages%2Fapi%2FsendMail.ts&middlewareConfigBase64=e30%3D!:11:84)
    at Module.(api)/../node_modules/next/dist/build/webpack/loaders/next-route-loader/index.js?kind=PAGES_API&page=%2Fapi%2FsendMail&preferredRegion=&absolutePagePath=.%2Fsrc%2Fpages%2Fapi%2FsendMail.ts&middlewareConfigBase64=e30%3D! (/redacted/path/.mailing/.next/server/pages/api/sendMail.js:342:1)
    at __webpack_require__ (/redacted/path/.mailing/.next/server/webpack-api-runtime.js:33:43) {
  clientVersion: '4.16.2',
  errorCode: undefined
}
 ✓ Compiled /_error in 155ms (688 modules)
mailing 500 /api/sendMail 928ms

Also worth noting, I'm actually not using Next.js (though that's not the worst guess given it's actually Remix)

To Reproduce
Steps to reproduce the behavior:

  1. setup the project as described in Getting Started
  2. apply Remix-specific modifications as described in Remix Integration
  3. add a simple api route to test sending emails (se code snippet below for example content)
  4. visit /email
  5. click "Force send" when Mailing intercepts the send attempt
  6. see the error in the server output
// app/routes/email.ts

import sendMail from "~/emails/send-mail.server";

export async function loader() {
  const result = await sendMail({
    subject: "A test email",
    to: "[email protected]",
    text: "Will this work? Seems like it should be pretty basic",
    html: "<p>Will this work? Seems like it should be pretty basic</p>",
  });

  return result ? result : "error";
}

Expected behavior
The email should send

Desktop (please complete the following information):

  • OS: macOS
  • Browser: Brave/Chrome
  • Version: 1.1.0

Additional context
I've tried setting up transports for sendmail and postmark with no changes in behavior.

@Horia73
Copy link

Horia73 commented Aug 12, 2024

any solution to this? I am encountering same issue

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants