79354121

Date: 2025-01-14 06:20:01
Score: 2
Natty:
Report link

I came across this post after receiving a similar error. I'm not sure if your situation is the same as mine, but my issue was related to me attempting to use server-side code in my client-side code.

One of my imports was not supported on the browser as it was meant to be used on the server side.

import { useEffect, useMemo, useState } from "react"
import { useAuth } from "./useAuth";
import { firestore } from "firebase-admin";
import { 
    setDoc, addDoc, collection, getDocs, getDoc, doc, updateDoc, query, 
    where, deleteDoc,
} from "firebase/firestore"; 

Here's the issue: 'import { firestore } from "firebase-admin";' I imported firestore incorrectly and used it in my code, which caused me to have similar errors, e.g:

ERROR in node:util Module build failed: UnhandledSchemeError: Reading from "node:util" is not handled by plugins (Unhandled scheme). Webpack supports "data:" and "file:" URIs by default. You may need an additional plugin to handle "node:" URIs.

ERROR in node:stream Module build failed: UnhandledSchemeError: Reading from "node:stream" is not handled by plugins (Unhandled scheme). Webpack supports "data:" and "file:" URIs by default. You may need an additional plugin to handle "node:" URIs.

Basically, before you start deleting and changing a whole bunch of stuff, I suggest checking your imports/code, and if you are planning to use server-side functions then they need to be in a separate file from my understanding.

Reasons:
  • Long answer (-1):
  • Has code block (-0.5):
  • Me too answer (2.5): have similar error
  • Low reputation (1):
Posted by: Jurai