Skip to content

Uncaught ReferenceError: process is not defined #38

Closed
@ericsoco

Description

@ericsoco

Subject of the issue

The VFile constructor references process directly. In a vanilla browser environment, this throws an error. However, many build systems polyfill process so this may have gone unnoticed in most applications -- process is mocked by default by Webpack, and Browserify does something similar.

Your environment

  • OS: Mac OSX 10.14.5
  • Packages: unified@6.2.0, vfile@2.3.0 (via react-markdown@4.2.2)
  • Env:
    • node@10.16.0
    • npm@6.9.0
    • yarn@1.16.0
    • Chrome v76.0.3809.132

Steps to reproduce

In an environment without a global process object (e.g. a vanilla browser, a webpack build with the process mock disabled):

Expected behaviour

The VFile() constructor instantiates an object.

Actual behaviour

The VFile() constructor throws.

Metadata

Metadata

Assignees

No one assigned

    Labels

    🙅 no/wontfixThis is not (enough of) an issue for this project🙋 no/questionThis does not need any changes

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions