-
Notifications
You must be signed in to change notification settings - Fork 970
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
Getting error while trying to browse absolute path in firebase (Angular Universal app) #1705
Comments
Sorry you're having troubles! This sounds like a bug in the Functions code that you're using could you provide:
|
Hi @bkendall , Here's the details you asked content in
I've one more function to handle contact form (using node mailer) and it's working fine. Previously, I had a problem which says can't fine server/main in Contents of firebase.json (Only rewrite rule is edited by me)
The tutorial I followed suggest to comment out the below lines in server.ts
I tried with and without the lines but both aren't working.
I can visit the home page and from there, I can navigate to any page, which means relative urls are working. But absolute urls aren't. when I enter url directly, it doesn't work. |
Curious... nothing sticking out at me yet... here's what I would look for:
|
Getting 500 as status while entering the url with path. Here's the response headers for both requests.
Versions
I can't figure out the root cause yet,
And I think the error in functions logs comes from firebase itself because it doesn't contain a reference to files from third party. |
A follow up: I changed this line in functions/dist/server.js
to this
and in firebase-functions/lib/providers/https.js, changed this
to this
And got this in firebase console
|
Hi @bkendall , I spent a lot of time in it and it turned out to be a file missing error. I updated the favicon long ago and the new name of the file was fav-icon.ico instead of favicon.ico but I forgot to update it in angular.json. The error in firebase functions' console is not helpful at all and I had to spent more than 3 days to find the root cause. Sorry for wasting your time. |
[REQUIRED] Environment info
firebase-tools: 7.2.4
Platform: Windows
[REQUIRED] Test case
I followed the official article to add universal to my angular app and then this article to deploy it to firebase.
npm run build:ssr && npm run serve:ssr
and alsofirebase serve
works fine. I can view it in my system.After deploying, if I visit the home page, I can navigate to any route from it and everything is fine but when I enter a url which contains a path, directly, it produce the following error
In Firebase functions log, I'm getting the following
The dist/server.js is autogenerated one
[REQUIRED] Steps to reproduce
This is an instance of my app https://v2.self.demo.sagarvd.me If you access it directly, it'll redirect you to
/home
and you can navigate to any route from navbar. But if you visit the same link with a path attached, you'll get the error mentioned above, for example https://v2.self.demo.sagarvd.me/home[REQUIRED] Expected behavior
Firebase should handle the routing
[REQUIRED] Actual behavior
Firebase handles the routes only if visited the domain home page. Otherwise it throws error.
The text was updated successfully, but these errors were encountered: