-
-
Notifications
You must be signed in to change notification settings - Fork 375
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
Pre-render 'Template execution failed' when importing Firebase Auth v9 #1633
Comments
I also ran into a similar issue on preact-cli 3.3.3, but the following steps seemed to fix it:
I use firebase auth as well, but that doesn't seem to be causing any problems (anymore?).
|
Sorry, are you saying the error message changed upon upgrading preact-cli to v3.3.5 / past 3.3.3? Makes sense that Firebase may not be suitable in Node when we prerender, but the new error message sounds odd to me. Nothing we've touched should've changed that I don't believe. Glad it's working regardless. |
That's what I thought. I was being a bit presumptuous though. I made several changes before re-running the build command and assumed it was the preact-cli version upgrade that changed the build error message. It appears what changed the error message was the deletion of a single line, removal of firebaseui from the app:
outputs
switches the message to the new and more detailed one in my comment above. |
Gotcha! Just needed a sanity check as I couldn't imagine how an error message would change given our past few changes here. That would probably indicate something got touched that shouldn't have. Need to take some time and think of how we can improve the error messages a bit, as this is... less than clear. Glad there's a solution for it though! Appreciate you writing this. |
What is the current behaviour?
I'm working on a project that uses Firebase v9 and I'm getting an error when I run
npm run build
:The error is thrown in
prerender.js
@ line 18:When I check the
./ssr-build/ssr-bundle.js
it's trying to require, I can see the syntax error.To be honest, I'm not sure if this is the right project to file this issue. It looks like it's Terser messing up the
ssr-bundle.js
or maybe it's Firebase's auth module that has some syntax that causes Terser to mess up, etc, but I guess I have to start filing the issue somewhere :)Steps to Reproduce
Steps to reproduce the behavior:
npx preact-cli create default my-project
npm i firebase
(note: I have the latest 9.6.1 version){ getAuth } from 'firebase/auth'
insrc/routes/Home/
npm run build
I've included a zip of a project that I created using these steps.
npm install && npm run build
firebase-auth-ssr-minimize-error--zip.zip
What is the expected behaviour?
ssr-bundle.js
should not contain a javascript syntax error causing the build to fail.Please mention any other relevant information
--no-prerender
preact.config.js
:config.optimization.minimize = false;
Both the 'modular' v9 as the 'compat' version of Firebase Auth causes the error:
npx preact-cli info:
The text was updated successfully, but these errors were encountered: