Nodemailer 无法在 nextjs 中工作,说找不到模块:无法解析“流”

问题描述 投票:0回答:1

找不到模块:无法解析“流”https://nextjs.org/docs/messages/module-not-found 导入请求模块的跟踪

https://nextjs.org/docs/messages/module-not-found
Import trace for requested module:
./node_modules/nodemailer/lib/mime-node/index.js
./node_modules/nodemailer/lib/mail-composer/index.js
./node_modules/nodemailer/lib/mailer/index.js
./node_modules/nodemailer/lib/nodemailer.js
./app/api/contact/route.js

我浏览了那里的文档,但没有找到任何解决方案。

next.js stream nodemailer edge-runtime
1个回答
0
投票

您没有澄清您的源代码,但我猜问题来自根布局中的边缘运行时代码。如果您需要在项目中使用边缘运行时,您仍然可以从根布局中删除它,以防您需要添加

export const runtime = "edge"

将此行添加到项目中的每个 page.js。

© www.soinside.com 2019 - 2024. All rights reserved.