Payload 2.0 - Module dotenv not found

default discord avatar
tyteen4a03
last month
5

Getting this error when running dev server on Payload 2.0:



ERROR in ./src/payload.config.ts 130:0-28
Module not found: Error: Can't resolve 'dotenv' in '/Users/tyteen4a03/Documents/CodeProjects/Crisis/christmas-js/apps/backend/src'

webpack compiled with 1 error and 1 warning
Watchpack Error (watcher): Error: ENOTDIR: not a directory, watch '/Users/tyteen4a03/Documents/CodeProjects/Crisis/christmas-js/node_modules/@payloadcms/bundler-webpack/dist/mocks/emptyModule.js/mocks'
Watchpack Error (initial scan): Error: ENOTDIR: not a directory, scandir '/Users/tyteen4a03/Documents/CodeProjects/Crisis/christmas-js/node_modules/@payloadcms/bundler-webpack/dist/mocks/emptyModule.js/mocks'
Watchpack Error (initial scan): Error: ENOTDIR: not a directory, scandir '/Users/tyteen4a03/Documents/CodeProjects/Crisis/christmas-js/node_modules/@payloadcms/bundler-webpack/dist/mocks/emptyModule.js'
Open the post
Continue the discussion in Discord
Like what we're doing?
Star us on GitHub!

Star

Connect with the Payload Community on Discord

Discord

online

Can't find what you're looking for?

Get help straight from the Payload team with an Enterprise License.