Nextjs 14 API
I am using firebase for chat in my app. Create API for for i get below errors when i build my app. Path (app/api/(chat)/users)
./node_modules/@firebase/database-compat/dist/index.standalone.js:13:1
Module not found: Can't resolve 'tls'
https://nextjs.org/docs/messages/module-not-found
Import trace for requested module:
./node_modules/firebase-admin/lib/app/firebase-namespace.js
./node_modules/firebase-admin/lib/default-namespace.js
./node_modules/firebase-admin/lib/index.js
./app/api/(chat)/firebase/config.js
./app/api/(chat)/users/route.js
./node_modules/next/dist/build/webpack/loaders/next-edge-app-route-loader/index.js?absolutePagePath=private-next-app-dir%2Fapi%2F(chat)%2Fusers%2Froute.js&page=%2Fapi%2F(chat)%2Fusers%2Froute&appDirLoader=bmV4dC1hcHAtbG9hZGVyP25hbWU9YXBwJTJGYXBpJTJGKGNoYXQpJTJGdXNlcnMlMkZyb3V0ZSZwYWdlPSUyRmFwaSUyRihjaGF0KSUyRnVzZXJzJTJGcm91dGUmcGFnZVBhdGg9cHJpdmF0ZS1uZXh0LWFwcC1kaXIlMkZhcGklMkYoY2hhdCklMkZ1c2VycyUyRnJvdXRlLmpzJmFwcERpcj0lMkZob21lJTJGYmVhc3QlMkZEZXNrdG9wJTJGbXQtdjEtY2xvdWRmbGFyZS1wb2MlMkZhcHAmYXBwUGF0aHM9JTJGYXBpJTJGKGNoYXQpJTJGdXNlcnMlMkZyb3V0ZSZwYWdlRXh0ZW5zaW9ucz10c3gmcGFnZUV4dGVuc2lvbnM9dHMmcGFnZUV4dGVuc2lvbnM9anN4JnBhZ2VFeHRlbnNpb25zPWpzJmJhc2VQYXRoPSZhc3NldFByZWZpeD0mbmV4dENvbmZpZ091dHB1dD0mcHJlZmVycmVkUmVnaW9uPSZtaWRkbGV3YXJlQ29uZmlnPWUzMCUzRCE%3D&nextConfigOutput=&preferredRegion=&middlewareConfig=e30%3D!
./node_modules/@google-cloud/firestore/build/src/index.js:19:1
Module not found: Can't resolve 'stream'
https://nextjs.org/docs/messages/module-not-found
./node_modules/@firebase/database-compat/dist/index.standalone.js:13:1
Module not found: Can't resolve 'tls'
https://nextjs.org/docs/messages/module-not-found
Import trace for requested module:
./node_modules/firebase-admin/lib/app/firebase-namespace.js
./node_modules/firebase-admin/lib/default-namespace.js
./node_modules/firebase-admin/lib/index.js
./app/api/(chat)/firebase/config.js
./app/api/(chat)/users/route.js
./node_modules/next/dist/build/webpack/loaders/next-edge-app-route-loader/index.js?absolutePagePath=private-next-app-dir%2Fapi%2F(chat)%2Fusers%2Froute.js&page=%2Fapi%2F(chat)%2Fusers%2Froute&appDirLoader=bmV4dC1hcHAtbG9hZGVyP25hbWU9YXBwJTJGYXBpJTJGKGNoYXQpJTJGdXNlcnMlMkZyb3V0ZSZwYWdlPSUyRmFwaSUyRihjaGF0KSUyRnVzZXJzJTJGcm91dGUmcGFnZVBhdGg9cHJpdmF0ZS1uZXh0LWFwcC1kaXIlMkZhcGklMkYoY2hhdCklMkZ1c2VycyUyRnJvdXRlLmpzJmFwcERpcj0lMkZob21lJTJGYmVhc3QlMkZEZXNrdG9wJTJGbXQtdjEtY2xvdWRmbGFyZS1wb2MlMkZhcHAmYXBwUGF0aHM9JTJGYXBpJTJGKGNoYXQpJTJGdXNlcnMlMkZyb3V0ZSZwYWdlRXh0ZW5zaW9ucz10c3gmcGFnZUV4dGVuc2lvbnM9dHMmcGFnZUV4dGVuc2lvbnM9anN4JnBhZ2VFeHRlbnNpb25zPWpzJmJhc2VQYXRoPSZhc3NldFByZWZpeD0mbmV4dENvbmZpZ091dHB1dD0mcHJlZmVycmVkUmVnaW9uPSZtaWRkbGV3YXJlQ29uZmlnPWUzMCUzRCE%3D&nextConfigOutput=&preferredRegion=&middlewareConfig=e30%3D!
./node_modules/@google-cloud/firestore/build/src/index.js:19:1
Module not found: Can't resolve 'stream'
https://nextjs.org/docs/messages/module-not-found
0 Replies