Reference Error:在Next.js中未定义出口错误

发布于 2025-02-11 14:14:12 字数 552 浏览 2 评论 0原文

我看到了以下错误datetime-picker v3.5.0和next.js。

Unhandled Runtime Error
ReferenceError: exports is not defined

Call Stack
eval
node_modules/react-datetime-picker/dist/DateTimePicker.js (8:0)
./node_modules/react-datetime-picker/dist/DateTimePicker.js
...
/_next/static/chunks/webpack.js (718:31)

next.config.js我有:

const withTM = require('next-transpile-modules')(['react-datetime-picker']); // pass the modules you would like to see transpiled
module.exports = withTM(nextConfig)

I am seeing the following error with react-datetime-picker v3.5.0 and Next.js.

Unhandled Runtime Error
ReferenceError: exports is not defined

Call Stack
eval
node_modules/react-datetime-picker/dist/DateTimePicker.js (8:0)
./node_modules/react-datetime-picker/dist/DateTimePicker.js
...
/_next/static/chunks/webpack.js (718:31)

In next.config.js I have:

const withTM = require('next-transpile-modules')(['react-datetime-picker']); // pass the modules you would like to see transpiled
module.exports = withTM(nextConfig)

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

欢烬 2025-02-18 14:14:12

外观与V12.2.0版本中引入的错误有关。请参阅相关的GitHub问题: https://github.com/github.com/vercel.com/vercel.com/vercel/next.js/issues/issues/issues/issues /38117

您现在应该将Next.js降级到v12.1.6。

Looks related to a bug introduced in the v12.2.0 release. See related GitHub issue: https://github.com/vercel/next.js/issues/38117.

You should downgrade Next.js to v12.1.6 for now.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文