You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
This should only load the Firebase Authentication SDK when signupWithGoogle is actually called client-side. Thus, the @firebase/auth module should not be included in the "first load JS" sizes outputted by next build.
But, it appears that they are because there was no change in those "first load JS" numbers after I added the dynamic import (that was previously a static import):
And there should definitely be at least a 50 KB difference:
What's strange is that the /[locale]/signup page size did seem to change slightly, which might have been due to me adding a similar dynamic import:
importfirebasefrom'firebase/app';exportfunctionPhotoInput(): JSX.Element{// An event handler on a `PhotoInput` component that is used to collect the user's// profile photo on the signup page.consthandleChange=async(event: React.FormEvent<HTMLInputElement>)=>{constfile: File=event.currentTarget.files[0];constlastDotIndex: number=file.name.lastIndexOf('.');constfilename: string=file.name.substring(0,lastDotIndex);constextension: string=file.name.substring(lastDotIndex+1);constpathname=`${process.env.NODE_ENV==='development' ? 'test' : 'default'}/temp/${uuid()}.${extension}`;setHelperValue(`Uploading ${filename}.${extension}...`);// I dynamically import the Firebase Storage SDK which I use to upload the user's // profile photo.awaitimport('firebase/storage');};}
To Reproduce
See the code snippets above. If needed, I can also create a repro (just comment if you want one).
Expected behavior
A clear and concise description of what you expected to happen.
The dynamic imports should show up in the bundle-analyzer output, but they shouldn't be included in the "First load JS" sizes that are logged by next build.
System information
OS: Ubuntu 18.04.2
Version of Next.js: 9.4.4
Version of Node.js: 12.16.1
The text was updated successfully, but these errors were encountered:
This issue has been automatically locked due to no recent activity. If you are running into a similar issue, please create a new issue with the steps to reproduce. Thank you.
vercel
locked as resolved and limited conversation to collaborators
Jan 29, 2022
Sign up for freeto subscribe to this conversation on GitHub.
Already have an account?
Sign in.
Bug report
Describe the bug
A clear and concise description of what the bug is.
To reduce the "first load JS" bundle sizes, I'm dynamically importing the individually installable Firebase services only when they're needed:
This should only load the Firebase Authentication SDK when
signupWithGoogle
is actually called client-side. Thus, the@firebase/auth
module should not be included in the "first load JS" sizes outputted bynext build
.But, it appears that they are because there was no change in those "first load JS" numbers after I added the dynamic import (that was previously a static import):
Before:
After:
And there should definitely be at least a 50 KB difference:
What's strange is that the
/[locale]/signup
page size did seem to change slightly, which might have been due to me adding a similar dynamic import:To Reproduce
See the code snippets above. If needed, I can also create a repro (just comment if you want one).
Expected behavior
A clear and concise description of what you expected to happen.
The dynamic imports should show up in the
bundle-analyzer
output, but they shouldn't be included in the "First load JS" sizes that are logged bynext build
.System information
The text was updated successfully, but these errors were encountered: