-
Notifications
You must be signed in to change notification settings - Fork 148
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
Error with create-react-app: Failed to minify the code from firestore/src/validate.js:27 #93
Comments
Thanks for reporting this. We are currently using some ES6 features that are compatible with Node 4. I will discuss with the rest of the team whether we can publish ES5-only versions. |
@stephenplusplus - Do you mind weighing in on this? |
Related issues:
If the only thing stopping integration with our modules is that we use ES6 (I doubt this is the case, historically, users have run into many quirks), I think the user could probably find an ES6-to-5-ifier that could run during their compilation step. More generally, we don't offer any direct support for our libraries outside of the conventional Node.js runtime environments. We would need a call from @alexander-fenster if we should reconsider. |
Is anyone working on this? This is blocking anyone using create-react-app with Firestore. @mylbp2ps3 did you ever find a fix? |
Turns out the issue is contained with I am using Realtime Database for now but dissatisfied with this solution because Firestore is the future. |
We are not currently working on this, but would appreciate more user feedback. |
Thanks for the response @schmidt-sebastian! I hope this moves up the priority ladder soon! |
@mylbp2ps3, @kaiyuanneo et al, I'm able to build without a problem using the same build command OS: Mac High Sierra
What is your version of react-scripts? Have you been able to reproduce this error on a new CRA app? Also, I tend to have less issues when customizing CRA projects using |
@mylbp2ps3 did you end up with a solution to this? We have the same exact problem. I know there are listed solutions provided above, but I'm not certain how to take any of those steps. #2 sounds plausible, but I don't even know where to begin with the @Google-Cloud module. I just would really like to get passed this validate.js file that's causing the build to fail. @willhlaw I created a different CRA app and was able to build it without a problem. However, once I added the files that use the @Google-Cloud module under firestore, it fails. This is my first time attemping to build a webapp that's dependent on so many modules and I'm pulling my hair out to get out of this one. I need the firestore dependency and going to the RealTime Database is not an option. I'd appreciate anyone's insight. Thanks in advance. ├── firebase-admin@5.10.0 |
I'm having exactly the same issue. I installed everything w/in the last month. I should say that everything that I'm writing is all ES6. The admin template I bought was ES5, but I converted the stuff that I use to ES6. I'm also using Babel, so maybe I should except firebase-admin? Windows 10 Home |
My site has been working fine for a few months and now all of a sudden I can't build it anymore.
I'm also using ES6. Using the Fireadmin template . Update: Searching around it has to do with the firebase-admin package via this thread. I had added it to the fireadmin template to add some additional functionality that I ended up not using. I uninstalled the package and the build ran fine. This may not be an option for everyone, but at least you'll know where to start looking. |
Closing this due to inactivity. Feel free to re-open should this still be an issue. |
Environment details
I'm using create-react-app, and first added firebase hosting, and deployed it. No problem. Then I added firebase-admin, tried running yarn build, but it gives this error:
I tried going into validate.js line 27, and changing it from:
to:
which fixed the issue on that line, however it then couldn't minify line 48, and I wasn't able to find a fix for this line.
create-react-app says this about the error:
npm run build
fails to minifySome third-party packages don't compile their code to ES5 before publishing to npm. This often causes problems in the ecosystem because neither browsers (except for most modern versions) nor some tools currently support all ES6 features. We recommend to publish code on npm as ES5 at least for a few more years.
To resolve this:
module
field inpackage.json
. Note that even if a library provides an ES Modules version, it should still precompile other ES6 features to ES5 if it intends to support older browsers.Fork the package and publish a corrected version yourself.
If the dependency is small enough, copy it to your
src/
folder and treat it as application code.In the future, we might start automatically compiling incompatible third-party modules, but it is not currently supported. This approach would also slow down the production builds.
The text was updated successfully, but these errors were encountered: