1

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)
juliomalves
  • 42,130
  • 20
  • 150
  • 146
Viraj
  • 777
  • 1
  • 13
  • 32
  • 1
    What Next.js version are you using? Looks related to this GitHub issue https://github.com/vercel/next.js/issues/38117, seems to have been introduced in the 12.2.0 release. Try downgrading `next` for now. – juliomalves Jul 02 '22 at 20:33
  • 1
    Yes. I was using 12.2.0. Thank you for sharing the issue link. – Viraj Jul 04 '22 at 06:58

1 Answers1

2

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.

juliomalves
  • 42,130
  • 20
  • 150
  • 146