Module not found: Error: Package path ./compat is not exported from package - reactjs

I'm working on my project and all of a sudden, I got the following message from the compiler and don't know how to solve the problem:
ERROR in ./src/frontend/service/AuthService.ts 8:0-39
Module not found: Error: Package path ./compat is not exported from package /Users/chuben/Desktop/Coding_Projects/ecommerce-react-node/final.frontend.project/node_modules/firebase (see exports field in /Users/chuben/Desktop/Coding_Projects/ecommerce-react-node/final.frontend.project/node_modules/firebase/package.json)
ERROR in ./src/frontend/ui/page/RegisterPage/index.tsx 14:0-39
Module not found: Error: Package path ./compat is not exported from package /Users/chuben/Desktop/Coding_Projects/ecommerce-react-node/final.frontend.project/node_modules/firebase (see exports field in /Users/chuben/Desktop/Coding_Projects/ecommerce-react-node/final.frontend.project/node_modules/firebase/package.json)
I don't understand what the problem is and how should I export the path correctly? I will really appreciate anyone who can help solve this problem. Thanks in advance!
Hopefully, I don't have to do everything from scratch by starting a new project.

I found the issue there. I shouldn't set the following in my React page, or else the system will try to search the module for the variable or sth.
const [firebaseUid,setFirebaseUid]=useState<String|undefined>(undefined);

Related

I am getting error related to firebase when i am doing project in react

Compiled with problems:X
ERROR in ./src/App.js 8:0-30
Module not found: Error: Package path . is not exported from package C:\Users\HARDEE RAVAL\Desktop\ig clone\instagram-clone\node_modules\firebase (see exports field in C:\Users\HARDEE RAVAL\Desktop\ig clone\instagram-clone\node_modules\firebase\package.json)
Did you mean './firebase'?
Requests that should resolve in the current directory need to start with './'.
Requests that start with a name are treated as module requests and resolve within module directories (node_modules, C:\Users\HARDEE RAVAL\Desktop\ig clone\instagram-clone\node_modules).
If changing the source code is not an option there is also a resolve options called 'preferRelative' which tries to resolve these kind of requests in the current directory too.
enter image description here
This is the problem that i am facing, please anyone who knows firebase, help me. Thanks in advance...

Module not found: Error: Can't resolve 'querystring' in 'C:\...\node_modules\flickr-sdk\lib''

I newly created a react app and installed flickr-sdk, then configured it and imported as following,
import flickrApi from "./api/flickr";
then I'm getting an error like this,
ERROR in ./node_modules/flickr-sdk/lib/request.js 7:12-40
Please help me out to sort this out, Thanks in advance

Failed to run nextjs project

error - ./node_modules/next/dist/client/dev/amp-dev.js
Module not found: Can't resolve 'C:\Users\User\Desktop\React Projektiudemy\app\next demo\first-next\node_modules\next\dist\compiled\regenerator-runtime\runtime.js' in 'C:\Users\User\Desktop\React Projekti\udemy\app\next demo\first-next\node_modules\next\dist\client\dev'
This is the error I get and i tried the answers on the stack. I tried babel downgrade and it didn't work. Can someone help me?
Thanks.
I found solution to this problem. The answer is to remove "ud" from the file path. I made new folder and installed next js. The code shows no error.
I did this for anyone that has similar problem.

react-dropdown-input Module not found: Error

I'm trying to use the react-dropdown-input library in my react project.
(https://www.npmjs.com/package/react-dropdown-input)
I used npm i react-dropdown-input and it installed.
But when I run my project, I get this errors:
ERROR in ./~/react-dropdown-input/index.js Module not found: Error: Can't resolve 'react/addons' in 'path\node_modules\react-dropdown-input'
And this one too
ERROR in ./~/react-dropdown-input/index.js
Module not found: Error: Can't resolve 'react/lib/joinClasses' in 'path\node_modules\react-dropdown-input'
I also tried to run this command: npm install #types/react-dropdown-input but that library doesn't exists.
This is my import line:
import DropdownInput from "react-dropdown-input";
In my code it also says this:
Could not find a declaration file for module 'react-dropdown-input'.
Does anyone knows why this is happening and how to solve this?
Tested on npm#6.4.1, node#10.13.0. It fails.
I tried cloning it. Looks like library in not maintained. Its last commit was around 5 years back.
You can have a look at React Autosuggest. Its provides exact features you are looking for.
Hope this helps.

Module not found: Can't resolve './AppRoutes'

I'm following this react workshop:
https://github.com/spietrek/workshop.reactjs.1/blob/master/presentation/Introduction%20to%20ReactJS%20Workshop.pdf
I'm following all the code but I'm getting an error:
Module not found: Can't resolve './AppRoutes'...
Here's the editable project url:
https://stackblitz.com/edit/react-project
I'm at pg 17/27
You have put a space before the name of the file AppRoutes.js like <space>AppRoutes.js.
You have to remove the space to fix that error.
After fixing this also in you project there are some errors due to Fragment. I fixed that by updating react and react-dom packages to version 16.2.0.
This is a working fork of you project.
If AppRoutes is a .jsx file you have to load it with the .jsx file extension. Like ./AppRoutes.jsx

Resources