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 at isObject v1.4.0 #1252

Closed
1 task
davidb-e4s opened this issue Apr 10, 2019 · 4 comments · Fixed by #1253
Closed
1 task

ReferenceError: File is not defined at isObject v1.4.0 #1252

davidb-e4s opened this issue Apr 10, 2019 · 4 comments · Fixed by #1253

Comments

@davidb-e4s
Copy link

Prerequisites

Description

Since 1.4.0 I'm now getting this error when trying to create a form

ReferenceError: File is not defined at isObject (/srv/node_modules/react-jsonschema-form/lib/utils.js:325:24) at getDefaultFormState (/srv/node_modules/react-jsonschema-form/lib/utils.js:288:8) at Form.getStateFromProps (/srv/node_modules/react-jsonschema-form/lib/components/Form.js:157:53) at new Form (/srv/node_modules/react-jsonschema-form/lib/components/Form.js:129:25)

I believe this is related the isObject file changes in 1.4.0

1.3.0 works fine

My browser is Chrome 73.0.3683.86 on Mac OS Mojave 10.14

Steps to Reproduce

  1. Update lib to 1.4.0
  2. Create a Form in react with no formData specified or an empty object
  3. The form fails to render with the above error
  4. Note I only observed this in a Next.js app v ^7.0.3

Expected behavior

The form to render correctly. Switching back to 1.3.0 makes the form work as expected.

Actual behavior

The form failed to error and the console showed the aforementioned error

Version

1.4.0

@paintedbicycle
Copy link
Contributor

I'm too am getting this everywhere in my app after updating to 1.40

@epicfaace
Copy link
Member

Hmm, so this seems to be happening in a node js environment, not the browser, is that right?

@paintedbicycle
Copy link
Contributor

You might be correct. I first noticed the Errors in my cloud function console (which runs node as the environment). So it's happening there.

I finally saw it in the browser and had to downgrade. However the browser error might have been caused by a crash in the node server powering the site (i.e. it might have been a server crash screen).

@davidb-e4s
Copy link
Author

I've not seen it in my pure react app so it could be when running on node. Using NodeJs10. Happens on both my local machine and when deployed to Google App Engine.

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

Successfully merging a pull request may close this issue.

3 participants