upstash / redis-js

HTTP based Redis Client for Serverless and Edge Functions
https://docs.upstash.com/redis
MIT License
666 stars 51 forks source link

Warning when building with Next 13 #307

Closed tcaputi closed 8 months ago

tcaputi commented 1 year ago

When compiling my app for Next 13 I get the following warning:

info  - Loaded env from /Users/tom/Development/projects/t3-true-finals/.env
info  - Linting and checking validity of types  
info  - Creating an optimized production build  
warn  - Compiled with warnings

./node_modules/@upstash/redis/esm/platforms/nodejs.js
A Node.js API is used (Buffer at line: 10) which is not supported in the Edge Runtime.
Learn more: https://nextjs.org/docs/api-reference/edge-runtime

Import trace for requested module:
./node_modules/@upstash/redis/esm/platforms/nodejs.js

./node_modules/@upstash/redis/esm/platforms/nodejs.js
A Node.js API is used (process.version at line: 44) which is not supported in the Edge Runtime.
Learn more: https://nextjs.org/docs/api-reference/edge-runtime

Import trace for requested module:
./node_modules/@upstash/redis/esm/platforms/nodejs.js

info  - Collecting page data  
info  - Generating static pages (46/46)
info  - Finalizing page optimization  

NextJS version: 13.1.2 Upstash redis version: 1.19.3 Upstash ratelimit version: 0.1.5

My app pretty much copy / pasted the ratelimitting code straight from here: https://upstash.com/blog/upstash-ratelimit

Thanks again for all your guys work. The ratelimitting example was super easy to get up and running.

chronark commented 1 year ago

Thanks, I'll check this out

github-actions[bot] commented 9 months ago

This issue is stale because it has been open 30 days with no activity. Remove stale label or comment or this will be closed in 30 days.

github-actions[bot] commented 8 months ago

This issue was closed because it has been stalled for 30 days with no activity.