Closed fysp11 closed 5 years ago
@fysp11 thanks for reporting! Im sure that the following issue is a bug but it's not related to #112 I will inspect that soon
@AnthonyNahas thanks man
Literally same problem, same warnings, it has to do something with the way you call firebase within the library, I've tried to work around it by placing NgxAuthFirebaseUIModule.forRoot()
inside of app.browser.module.ts to keep it outside of servers reach, but with no luck.
Hello.. I believe the ngx-auth-firebaseUI.forRoot(firebase) should be in app.module.ts, and then could be imported as module in any other module need it, according to the installation instructions. Regards
Sent from my iPhone
On 8 Feb 2019, at 21:14, Beatons notifications@github.com wrote:
Literally same problem, same warnings, it has to do something with the way you call firebase within the library, I've tried to work around it by placing FirebaseUIModule.forRoot() inside of app.browser.module.ts to keep it outside of servers reach, but with no luck.
— You are receiving this because you are subscribed to this thread. Reply to this email directly, view it on GitHub, or mute the thread.
I'm aware of that, I'm trying to do server side rendering, and the library is literally breaking the build, by saying that the
WARNING in ./node_modules/ngx-auth-firebaseui/esm5/ngx-auth-firebaseui.es5.js 162:31-35 "export 'auth' was not found in 'firebase/app' @ ./dist/server/main.js @ ./server.ts
I'm trying to find a work around, any help would be more than appreciated.
Im gonna try to fix that ASAP!!!👌
I've just patched the library and fixed the export bug related to the ssr issue. However, locally Im getting a DI error but I cant at the moment find out whether the DI issue is related to the library or to the local demo app...
I would appreciate your help if you can try v.2.3.2
Give me an hour and I'll come back to you
@AnthonyNahas the issue with exporting auth looks to be solved ✔️ . But I keep getting the following:
Warning: Flex Layout loaded on the server without FlexLayoutServerModule
Error retrieving icon:
I don't know if that's what you were talking about, but I think the @angular/flex-layout
is having some trouble during SSR.
UPDATE
Using the FlexLayoutServerModule
, it still send me the error message, but the application doesn't crash.
It's working 😕
@fysp11 the above log is related to flexlayout.. u just need to import the
FlexLayoutServerModule
in your angular server module file AppServerModule
Still anyone facing any problem with this issue after the patch v2.3.2
@AnthonyNahas I realized that some time after. I'm not getting any errors now.
Thanks man
I just run into the same issue. I am using Ant Design Pro which is a framework build upon umi whichi is built on React.
import request from '@/utils/request';
import * as firebase from "firebase/app";
import "firebase/auth";
export async function fakeAccountLogin(params) {
return request('/api/login/account', {
method: 'POST',
data: params,
});
}
export async function getFakeCaptcha(mobile) {
return request(`/api/login/captcha?mobile=${mobile}`);
}
export async function firebaseLogin(params) {
firebase.auth().createUserWithEmailAndPassword(email, password).catch(function(error) {
// Handle Errors here.
var errorCode = error.code;
var errorMessage = error.message;
// ...
});
}
`
I just run into the same issue. I am using Ant Design Pro which is a framework build upon umi whichi is built on React.
import request from '@/utils/request'; import * as firebase from "firebase/app"; import "firebase/auth"; export async function fakeAccountLogin(params) { return request('/api/login/account', { method: 'POST', data: params, }); } export async function getFakeCaptcha(mobile) { return request(`/api/login/captcha?mobile=${mobile}`); } export async function firebaseLogin(params) { firebase.auth().createUserWithEmailAndPassword(email, password).catch(function(error) { // Handle Errors here. var errorCode = error.code; var errorMessage = error.message; // ... }); }
`
Oh wait, I just found I come to the wrong issue.
Anyway, try:
import firebase from 'firebase'
require('firebase/auth')`
@Dragon201701 worked like anything. Thanks!!!!
Bug Report or Feature Request (mark with an
x
)OS and Version?
Windows 10
Versions
Webpack for ServerSide Rendering using AWS Lambda
My FirebaseModule
package.json
angular.json
Repro steps
Simply call
npm run build
. When it comes to the serverless part, it throws the warnings (Log 1). If I try to run thenpm server
(basiclynode ./dist/server.js
) for Server Side Rendering, it throws the errors (Log 2)(Log 1) The warnings log from the build:
(Log 1) The errors log when running server:
Mention any other details that might be useful
It looks like the problem is how
auth
/firebase
are imported and exported throughngx-auth-firebaseui
package. Not sure thoughIt might be related to #112