angular-universal-express-firebase icon indicating copy to clipboard operation
angular-universal-express-firebase copied to clipboard

Firebase log: Cannot find module 'tslib'

Open bob-lee opened this issue 8 years ago • 4 comments

  • Angular: 5.0.1
  • angular/cli: 1.5.0
  • without @nguniversal/module-map-ngfactory-loader as my project doesn't do lazy loading

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 avatar Nov 10 '17 00:11 bob-lee

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.

bob-lee avatar Nov 11 '17 22:11 bob-lee

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.

StudioTOB avatar Mar 01 '18 09:03 StudioTOB

@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.

davideast avatar Mar 01 '18 16:03 davideast

@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.

StudioTOB avatar Mar 01 '18 19:03 StudioTOB