davideast / angular-universal-express-firebase

A packaged Cloud Function to serve Angular Universal apps.
50 stars 9 forks source link

Firebase log: Cannot find module 'tslib' #17

Open bob-lee opened 6 years ago

bob-lee commented 6 years ago

Tried SSR following guide, firebase serve works well but after deploy, the web fails with Error: could not handle the request. Firebase trigger function log says it finished with status 'crash':

Error: Cannot find module 'tslib' at Function.Module._resolveFilename (module.js:469:15) at Function.Module._load (module.js:417:25) at Module.require (module.js:497:17) at require (internal/module.js:20:19) at Object.8e9l (/user_code/dist/main.bundle.js:1:3258) at n (/user_code/dist/main.bundle.js:1:211) at Object.bNRb (/user_code/dist/main.bundle.js:1:34420) at n (/user_code/dist/main.bundle.js:1:211) at Object.JwoV (/user_code/dist/main.bundle.js:1:11671) at n (/user_code/dist/main.bundle.js:1:211)

bob-lee commented 6 years ago

Current version 0.0.4 doesn't seem to work with Angular 5 yet. Downgraded to Angular 4.4.6 and got SSR back to work.

StudioTOB commented 6 years ago

I've installed this tslib module manually and then the error should be gone. However, when I deploy my app to firebase I get the following error: Error: Forbidden Your client does not have permission to get URL /ssr/ from this server.

I have no clue on what to do here.

davideast commented 6 years ago

@StudioTOB Make sure you're including some static files for Firebase Hosting in the public folder and deploy both. firebase deploy --only hosting,functions.

On another note, I do need to work on getting this up to Angular 6.

StudioTOB commented 6 years ago

@davideast Thanks for your reply. Can you show me where that folder should be. In the functions folder I have a dist folder and a dist-server folder. Does the public folder also have to be in the functions folder? And where do I have to tell firebase where this public folder lives?

Thanks for your time.