I´m working at the Firebase Web App course and when I try to build the Firebase Web App locally as described in chapter 4.3 then I get the following error message:
PS C:\DevelopIO\firebase-projects\FB_Send_DHT_Data> firebase serve –only hosting
(node:1844) [DEP0040] DeprecationWarning: The `punycode` module is deprecated. Please use a userland alternative instead.
(Use `node –trace-deprecation …` to show where the warning was created)
i hosting[esp-iot-app-86585]: Serving hosting files from: public
+ hosting[esp-iot-app-86585]: Local server: http://localhost:5000
when I try to run the local server http://localhost:5000 I get an “Unexpected Error occurs” and an additional message in the terminal window:
TypeError: Cannot read properties of undefined (reading ‘getTime’)
at Responder.provider (C:\Users\Acer Spin\AppData\Roaming\npm\node_modules\firebase-tools\node_modules\superstatic\lib\providers\fs.js:89:38)
at async Promise.all (index 0)
i hosting: ::1 – – [10/Nov/2024:13:25:45 +0000] “GET / HTTP/1.1” 500 – “-” “Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:132.0) Gecko/20100101 Firefox/132.0”
I will be very happy if anyone can help me with that issue.
Thanks a lot
Michael
Hi.
The first error means that the punycode module is deprecated in newer Node.js versions, which Firebase CLI might still use internally. There’s nothing we can do about it. Firebase must update to use the newer version.
However, that particular warning won’t prevent Firebase from running; it’s just a notice about potential future compatibility issues. So, you can ignore that.
Note that you’ll get that warning every time you run a Firebase command until the Firebase software fixes that issue.
__________________________
As for the other error, after searching for a while, it seems to be an incompatibility with Firebase and the newest version of NodeJS: https://github.com/firebase/firebase-tools/issues/7173
The workaround for this issue is to fix the error on the file.
On your computer, go to the following path
C:\Users\YOUR_USERNAME\AppData\Roaming\npm\node_modules\firebase-tools\node_modules\superstatic\lib\providers\
Open the fs.js file on VS Code or another text editing program.
Go to line 89.
Replace the following:
modified: stat.mtime.getTime(),
With:
modified: stat.mtimeMs,
Save the file and close it.
Try to run the command again:
firebase serve --only hosting
I tried this workaround and it worked for me.
Let me know if you can do it.
I’m sorry for the issues, but there’s nothing we can do about them as these are related to NodeJS and Firebase software, which is out of out of our control. We can do those workarounds an wait for NodeJS or Firebase to fix the issues on their end.
Regards,
Sara
Hello Sara,
thank you very much for your help, it works now!
But now I have another issue – it seems that the bootstrap css did not work. I see the webpage unformatted.
<I want to send here a Screeshot, but I can not find out how I can upload it>
Do you have an idea what Im doing wrong?
Your courses are the best, this is my third Random Nerd course I do and I learn a lot. Thank so much for that.
Best regards
Michael
Hi.
What a coincidence 😀
To share a picture, please upload it to google drive, dropbox, or imgur, and then send me a link to the file.
Regards,
Sara
Hello Sara,
here is the screenshot: https://drive.google.com/file/d/1QsuyWUFiswCnDl4SZMBKDgdbpkKHM9bE/view?usp=drive_link
best regards
Michael
Hello Sara,
I found the problem: I have a new version of bootstrap 5.3.3, I have changed the version number in the link, but I didn´t change the integrity value. I load the new link command from bootstrap homepage:
<link href=”https://cdn.jsdelivr.net/npm/bootstrap@5.3.3/dist/css/bootstrap.min.css” rel=”stylesheet” integrity=”sha384-QWTKZyjpPEjISv5WaRU9OFeRpok6YctnYmDr5pNlyT2bRjXh0JMhjY6hW+ALEwIH” crossorigin=”anonymous”>
This works now!
Best regards
Michael
Hello Sara,
when I click on the Login Button nothing happens. The browser console show following errors:
https://drive.google.com/file/d/1uRlRI9r9oiLEi1ECROqDzxLvd2J5bCb2/view?usp=drive_link
Hope you have an idea where is my fault.
Thanks a lot, regards
Michael
At that point, that’s perfectly normal.
As we mention in the eBook
“You can click on the Login button, and a new window will pop up to enter an email
address and a password. At the moment, it isn’t working yet.”
“We’ll add some code to our JavaScript files, and everything will start working. We’ve
only prepared the UI so far.”
Hello Sara,
oh sorry, I thought you mean the login didn´t work ….
Thanks for your help.
Best regards
Michael