Skip to content

process.cwd is not a function #499

@charlycou

Description

@charlycou

I'm trying to use json-schema-to-typescript to build typescript interface but I get this error

TypeError: process.cwd is not a function
    at node_modules/json-schema-to-typescript/dist/src/index.js (index.js:84:18)
    at __require (chunk-J43GMYXM.js?v=e61e879e:11:50)
    at dep:json-schema-to-typescript:1:16

From what I understood this process.cwd make sense only if run by node but not in browser. Do I need to mock the function to run it in a browser? I'm using Vite as bundler if anyone got in the same situation.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions