-
Notifications
You must be signed in to change notification settings - Fork 10.3k
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
Redux, Styled Components and Client-Side Only Error #5012
Comments
This sounds similar to #2360. Maybe there's a non-error value that's not being filtered out? Could you do a bit of
|
@m-allanson thanks this seems indeed to be related. When I try to console.log the stats object with |
So Maybe there's something else going on here. Are you able to share your repo? |
I shared the repo with you here on Github. Thanks for your help, I am not able to resolve the error. |
@m-allanson my error was related to importing firebase correctly. Instead of import * as firebase from "firebase/app";
import "firebase/auth"
const config = {
apiKey: process.env.GATSBY_API_KEY,
authDomain: process.env.GATSBY_AUTH_DOMAIN,
databaseURL: process.env.GATSBY_DATABASE_URL,
projectId: process.env.GATSBY_PROJECT_ID,
storageBucket: process.env.GATSBY_STORAGE_BUCKET,
messagingSenderId: process.env.GATSBY_MESSAGING_SENDER_ID
};
if (!firebase.apps.length) {
firebase.initializeApp(config);
}
const auth = firebase.auth();
export {
auth
}; I changed the file to import * as firebase from "firebase";
const config = {
apiKey: process.env.GATSBY_API_KEY,
authDomain: process.env.GATSBY_AUTH_DOMAIN,
projectId: process.env.GATSBY_PROJECT_ID,
};
if (!firebase.apps.length) {
firebase.initializeApp(config);
}
const auth = firebase.auth();
export {
auth
}; I am not experienced enough to be able to tell why this crashed the build process without returning any error. |
Hey @jhlabs, I got this to build by wrapping the firebase calls in
Does that work for you? The |
Ah, just saw your previous comment. Glad you got it working! |
@m-allanson thanks for your help! was hard to find that one. |
Description
First of all, thanks to Gatsby and the amazing community around it. I am creating a web page with landing pages, that are statically rendered and a /app/* section that requires login through firebase and renders client side. It is a similar setup to the one described in the docs here https://www.gatsbyjs.org/docs/building-apps-with-gatsby/. The /app/* routes are making use of Redux for authentication and redux-form. I am also making use of redux-thunk. With
gatsby develop
my site builds perfectly, but when I try to build the site the following error shows:I have followed every advice I could find in the issues here on Github and elsewhere, and would be very grateful for any solutions. Thanks a lot!
Steps to reproduce
Run gatsby build.
Expected result
The site should build successfully.
Actual result
The build step throws an error
Environment
npm list gatsby
): [email protected]gatsby --version
): 1.1.41File contents (if changed):
gatsby-config.js
:package.json
:gatsby-node.js
:gatsby-browser.js
:gatsby-ssr.js
:The text was updated successfully, but these errors were encountered: