Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Feat Telemetry error with wrangler #268

Closed
binou-31 opened this issue Nov 27, 2022 · 2 comments
Closed

Feat Telemetry error with wrangler #268

binou-31 opened this issue Nov 27, 2022 · 2 comments

Comments

@binou-31
Copy link

Hi,

After v1.6.1 with telemetry feature. It's impossible to run @upstash/redis with wrangler on Cloudflare Worker
Even if i set UPSTASH_DISABLE_TELEMETRY or not.

$ wrangler dev --local
[mf:err] /tmp/tmp-1158-u34FVafmubEJ/index.js:3967
      if (!process.env.UPSTASH_DISABLE_TELEMETRY) {
      ^

ReferenceError: process is not defined
    at new Redis2 (/opt/node_modules/@upstash/redis/esm/platforms/nodejs.js:25:9)
    at /opt/src/index.js:35:15
    at /tmp/tmp-1158-u34FVafmubEJ/index.js:4182:3
    at Script.runInContext (node:vm:141:12)
    at VMScriptRunner.runAsScript (/opt/node_modules/@miniflare/runner-vm/src/index.ts:25:12)
    at VMScriptRunner.run (/opt/node_modules/@miniflare/runner-vm/src/index.ts:84:12)
    at Miniflare.#reload (/opt/node_modules/@miniflare/core/src/index.ts:775:42)
    at Miniflare.getPlugins (/opt/node_modules/@miniflare/core/src/index.ts:1017:5)
    at createServer (/opt/node_modules/@miniflare/http-server/src/index.ts:369:19)
    at startServer (/opt/node_modules/@miniflare/http-server/src/index.ts:476:18)

issue is solved when i force v1.6.1 with npm install @upstash/redis@v1.6.1

@chronark
Copy link
Contributor

chronark commented Nov 27, 2022

The stacktrace indicates, you import from "@upastash/redis" but you should import from "@upstash/redis/cloudflare" when using cloudflare.

@binou-31
Copy link
Author

Everything works properly after changed the import statement like you said.

Thanks.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants