Scarygami / polymer-starter-kit-firebase-hosting

Using Cloud Functions for Firebase for differential serving of different Polymer builds.
7 stars 1 forks source link

Rewrite to function is not working #1

Open companyship opened 7 years ago

companyship commented 7 years ago

I don't see the serve function being triggered. When I visit the firebase hosting where I deployed, I get a 404. I'm using the firebase.json, the function and gulp you supplied. Am I missing something? Firebase says there is no index.html in the "public" folder.

Scarygami commented 7 years ago

Is this happening when you access the root of your app? i.e. https://your-app.firebaseapp.com without anything else.

The "source": "/" rewrite in the firebase.json should take care of this.

For all other URLs like https://your-app.firebaseapp.com/view1 the second rewrite rules triggers.

I have this example deployed as-is on https://scary-experiments.firebaseapp.com/ and it seems to be working fine.

contis2908 commented 7 years ago

I am actually experience something similar. Although the index.html file is found in my case, all additional files that get imported inside the index.html such as the app-shall and the webcomponets can't be found (404). I start to believe that this may have something to do with the firebase config .? As I experienced the same issue in similar cases. I can't get it to work out of the box.

companyship commented 7 years ago

I have downloaded the source code and created a new project on Firebase. After installing everything and deploying it to firebase, I guess I got a bit further, but it's not working 100%.

When I visit the url (https://conditional-serving.firebaseapp.com/), I get the message "Error: could not handle the request". The Firebase logs say:

5:19:18.917 PM
outlined_flag
serve
Function execution took 1271 ms, finished with status: 'crash'

5:19:18.907 PM
warning
serve
RequestError: Error: getaddrinfo ENOTFOUND conditional-serving.firebaseapp.com conditional-serving.firebaseapp.com:443 at new RequestError (/user_code/node_modules/request-promise/node_modules/request-promise-core/lib/errors.js:14:15) at Request.plumbing.callback (/user_code/node_modules/request-promise/node_modules/request-promise-core/lib/plumbing.js:87:29) at Request.RP$callback [as _callback] (/user_code/node_modules/request-promise/node_modules/request-promise-core/lib/plumbing.js:46:31) at self.callback (/user_code/node_modules/request/request.js:186:22) at emitOne (events.js:96:13) at Request.emit (events.js:188:7) at Request.onRequestError (/user_code/node_modules/request/request.js:878:8) at emitOne (events.js:96:13) at ClientRequest.emit (events.js:188:7) at TLSSocket.socketErrorListener (_http_client.js:309:9) at emitOne (events.js:96:13) at TLSSocket.emit (events.js:188:7) at connectErrorNT (net.js:1021:8) at _combinedTickCallback (internal/process/next_tick.js:80:11) at process._tickDomainCallback (internal/process/next_tick.js:128:9)

5:19:18.903 PM
warning
serve
Unhandled rejection

5:19:17.646 PM
outlined_flag
serve
Billing account not configured. External network is not accessible and quotas are severely limited. Configure billing account to remove these restrictions

5:19:17.646 PM
outlined_flag
serve
Function execution started
contis2908 commented 7 years ago

For some reason the server response is different when hosted compared to the local emulation. When I host it I am having the same error as you. However, when i run firebase serve --only functions,hosting it does find my index.html but returns 404 for every other file as I described it in my previous comment.

Update So it seems all imported files can't be found because it is looking with the wrong path?! Request URL: http://localhost:5001/nodefire-96b46/us-central1/serve (the above is used for the server file)

Request URL: http://localhost:5001/modern-es6/src/my-app.html (the above file can't be found)

jukbot commented 7 years ago

Any progress about Error: could not handle the request in firefox ??