Skip to content

ReferenceError: File is not defined (File constructor is part of the browser environment and is not natively available in Node.js) #1

@gugol2

Description

@gugol2

Where: react-and-the-vanishing-network/exercises/04.modern-react/01.solution.rsc/index.js -> line 192

Error: ReferenceError: File is not defined

Problem: File constructor is part of the browser environment and is not natively available in Node.js

Solution: Could be install a library that polyfills the File class -> I used 'file-api', that way the change is one line.

import { File } from 'file-api';

I hope it helps, cheers!

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions