Skip to content

JS client on the web: Undefined from require('fs') in isFileParam #2028

@delenius

Description

@delenius

Using the JS generator, I get undefined from require('fs') in the function isFileParam in ApiClient.js:

    if (typeof module === 'object' && module.exports &&
        (param instanceof Buffer || param instanceof require('fs').ReadStream)) {
      return true;
    }

I am using browserify, and I tried installing browserify-fs, and setting this in my package.json:

  "browser": {
    "fs": "browserify-fs"
  }

But I am not sure that this is the correct approach.

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions