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

Problem with webpack 4 : Object prototype may only be an Object or null: undefined #222

Closed
mebest100 opened this issue Nov 11, 2021 · 8 comments

Comments

@mebest100
Copy link

mebest100 commented Nov 11, 2021

I build react on webpack 4.44.2, but when compile complete and it will report Object prototype may only be an Object or null: undefined from Browser console
as follow screenshot:
image
image

It seems connected to graceful-fs, but I don't know how it come.
Could anybody told the root cause about the errors. Thx!

@atshweza
Copy link

I am also facing the same issue @mebest100 any workarounds?
index.tsx:366 Uncaught TypeError: Object prototype may only be an Object or null: undefined
at Function.setPrototypeOf ()
at polyfills.js:139
at patch (polyfills.js:141)
at patch (graceful-fs.js:104)
at Object. (graceful-fs.js:96)
at Object../node_modules/node-localstorage/node_modules/graceful-fs/graceful-fs.js (graceful-fs.js:429)

@dargmuesli
Copy link

See #216.

@mebest100
Copy link
Author

mebest100 commented Dec 8, 2021 via email

@Cyrelc
Copy link

Cyrelc commented Dec 31, 2021

Having the same issue with Laravel-mix v 6 which has this as a dependency. I read 216 but am uncertain how to identify a package which "is attempting to run in the browser but should only run on node". Any help would be greatly appreciated

Here is my dependency tree:
image

@Cyrelc
Copy link

Cyrelc commented Jan 5, 2022

Another message for the next person who finds this - I don't know why the issue pointed to graceful-fs but somebody - whether VSCode or mix or a misttype on my part that autocompleted - added an import to one of my files that was causing the issue

import { find } from 'laravel-mix/src/File'

@wangjia184
Copy link

I encountered the exactly same problem, the whole project can be found here

If I use the following version, everything is fine.
"svelte-language-server": "^0.13.9"

If I upgrade it, gracefulFs fails with the exactly same error
"svelte-language-server": "^0.14.0",

@yoshixi
Copy link
Contributor

yoshixi commented Mar 31, 2022

I am facing same issue in my nuxt project. The nuxt mode is spa.

@yoshixi
Copy link
Contributor

yoshixi commented Apr 1, 2022

version v4.2.5 or higher versions may cause this error.

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

6 participants