Skip to content
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

Throwing error while deploying in firebase-functions #44

Open
subhendukundu opened this issue Feb 23, 2019 · 2 comments
Open

Throwing error while deploying in firebase-functions #44

subhendukundu opened this issue Feb 23, 2019 · 2 comments

Comments

@subhendukundu
Copy link

I am trying to deploy my SSR app in firebase originally forked from this repo, after doing some modification in the app. Which works fine when I do sudo firebase serve --only functions,hosting but throwing error when I do firebase deploy. The reproducible repo is https://github.com/subhendukundu/template-react-ssr/tree/feature/react-router, which has a package.json https://github.com/subhendukundu/template-react-ssr/tree/feature/react-router/public I am using the public directory as my function directory as well, https://github.com/subhendukundu/template-react-ssr/blob/feature/react-router/firebase.json

However even if I am using a different function directory for my cloud functions I see the same errors. Is there anyway I can fix it?
Error message:

Function failed on loading user code. Error message: Code in file index.js can't be loaded.
Is there a syntax error in your code?
Detailed stack trace: TypeError: react_universal_component__WEBPACK_IMPORTED_MODULE_2___default(...) is not a function
    at Object.<anonymous> (/user_code/assets/app.server.js:1525:128)
    at Object.module.exports.hasOwnProperty (/user_code/assets/app.server.js:1547:30)
    at __webpack_require__ (/user_code/assets/app.server.js:27:30)
    at Object.<anonymous> (/user_code/assets/app.server.js:13330:26)
    at __webpack_require__ (/user_code/assets/app.server.js:27:30)
    at Object.<anonymous> (/user_code/assets/app.server.js:8001:18)
    at __webpack_require__ (/user_code/assets/app.server.js:27:30)
    at /user_code/assets/app.server.js:104:18
    at Object.<anonymous> (/user_code/assets/app.server.js:107:10)
    at Module._compile (module.js:577:32)
    at Object.Module._extensions..js (module.js:586:10)
    at Module.load (module.js:494:32)
    at tryModuleLoad (module.js:453:12)
    at Function.Module._load (module.js:445:3)
    at Module.require (module.js:504:17)
    at require (internal/module.js:20:19)

Please note that the original error massage was TypeError: c(...) is not a function at Object.. I have turned off the minifiation to see the error message at the moment, still confused what's going wrong.

@rherwig
Copy link
Owner

rherwig commented Feb 28, 2019

Hmm... I am definitely not an expert in terms of firebase. But this seems to be an error caused by dynamic importing a universal component. Does your code work, if you omit universal component?

@subhendukundu
Copy link
Author

subhendukundu commented Mar 3, 2019

Ahh, this one driving me crazy. 🙈😅 I have no clue how to go with this issue. I just moved all of my app to static deployment (with a index.html, no dynamic importing), works perfectly.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants