RJR
Convex Community3y ago
13 replies
RJ

Accessing env variables + TS errors

When trying to access an environment variable in a Convex action (per https://docs.convex.dev/using/environment-variables#accessing-environment-variables), TypeScript complains that it doesn't know what process is:

Cannot find name 'process'. Do you need to install type definitions for node? Try npm i --save-dev @types/node and then add 'node' to the types field in your tsconfig. (tsserver 2591)

I see in Convex's tsconfig.json the following:

    /* Prevents node_modules from adding additional global types e.g. node types */
    "types": []


Any thoughts on what I ought to do here? I'd think everyone would encounter this when trying to use environment variables in their Convex actions, unless the Convex-generated tsconfig.json file has changed its contents since I last generated it 🤔
Was this page helpful?