Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Open
gugol2 opened this issue Jan 25, 2025 · 0 comments

Comments

@gugol2
Copy link

gugol2 commented Jan 25, 2025

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!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant