Bare `process` import breaks Deno compatibility

Open Beginner friendly
#133 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Assessment

Difficulty
2/5
Estimated time
1-3 hours
Newbie friendliness
65/100
Issue type
Bug
Clarity
Clearly specified
Activity status
Quiet
Tech stack
eslint, node.js, typescript
Domain
api

Research direction

Start with src/configuration.ts:4 and reproduce the import failure using the Deno command and test.ts setup described in the issue. Check the existing ESLint configuration for where the unicorn/prefer-node-protocol rule belongs. Done means the SDK imports without the reported Deno error and linting prevents bare Node.js built-in imports.

Written by the indexing model from the issue text.

Description

Description

The SDK crashes when imported in Deno due to a bare process specifier in src/configuration.ts:4:

import { arch, platform, version as nodeVersion } from 'process';

Deno requires the node: prefix for Node.js built-in modules. This causes a fatal SyntaxError:

error: Uncaught SyntaxError: The requested module 'process' does not provide an export named 'arch'

Steps to reproduce

  1. Install Deno
  2. Create a test file:
import Zitadel from "./dist/index.js";
const client = Zitadel.withAccessToken("https://example.zitadel.cloud", "fake-token");
  1. Run: deno run --allow-read --allow-env --allow-net --allow-sys test.ts

Expected behavior

The SDK should import and work without errors in Deno.

Proposed fix

  1. Change from 'process' to from 'node:process' in src/configuration.ts
  2. Add eslint-plugin-unicorn with the unicorn/prefer-node-protocol rule to prevent regressions
Dominant language
TypeScript
Stars
10
Forks
3
PR merge metrics
No merged PRs in 30d

Contributor guide

No contributing guide indexed for this repository

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

More from zitadel/zitadel-node

All issues in zitadel/zitadel-node

Similar issues

More TypeScript issues

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.