prev Kozaneba Development Diary

Today’s Picture of the Day image


image image I found that Google is telling me “This browser is not secure and will not let you log in” in a Cypress environment, this is… what should I do…

This is what happens when you can log in image

image

image

https://github.com/prescottprue/cypress-firebase

Error Your API key is invalid, please check you have copied it correctly. I thought it would be easy to do, but I ran into an error with little information.

Maybe it would be better to configure Local Emulator Suite and do the authentication on a local server https://firebase.google.com/docs/emulator-suite/install_and_configure?hl=ja

2021-08-04 $ firebase init emulators :

=== Project Setup

First, let's associate this project directory with a Firebase project.
You can create multiple project aliases by running firebase use --add, 
but for now we'll just set up a default project.

? Please select an option: Use an existing project

Error: Failed to list Firebase projects. See firebase-debug.log for more info.

They say the old version of the login information fails, so you should log in again. $ firebase logout $ firebase login OK, done.

$ firebase emulators:start

  • image
  • image
  • image It’s not an anonymous login, but it’s showing up as anonymous because there’s no displayName.

Users can be configured on the emulator side image image image The user name is displayed properly.


$ firebase emulators:start :

⚠  firestore: Did not find a Cloud Firestore rules file specified in a firebase.json config file.
⚠  firestore: The emulator will default to allowing all reads and writes. Learn more about this option: https://firebase.google.com/docs/emulator-suite/install_and_configure#security_rules_configuration.

https://firebase.google.com/docs/emulator-suite/install_and_configure#security_rules_configuration

There is a syntax error in the official sample, though. I wrote a configuration file and installed Java and it worked.

image

Firestore is running locally, so I can always delete the whole thing without regret, and I’ll try to save it in a mess.

  • I mean, if you can’t delete everything from the test code, the test will behave differently, as it should.
  • There was there, there was there

Cypress+Firestore=invalid data

Cypress+Firestore+experimentalForceLongPolling=CORB

firebase.firestore().settings({ experimentalForceLongPolling: true })

https://githubmemory.com/repo/firebase/firebase-js-sdk/issues/4917

you should be using the useEmulator() after the firestore.settings({ experimentalAutoDetectLongPolling: true }).

ts

const db = firebase.firestore();
// NG
db.useEmulator("localhost", 8080); 
db.settings({ experimentalForceLongPolling: true });
// OK
db.settings({ experimentalForceLongPolling: true });
db.useEmulator("localhost", 8080);

it works! image

  • ExperimentalForceLongPolling must be set to true
  • You need to do this before you useEmulator.

next Kozaneba Development Diary 2021-08-05


This page is auto-translated from /nishio/Kozaneba開発日記2021-08-03 using DeepL. If you looks something interesting but the auto-translated English is not good enough to understand it, feel free to let me know at @nishio_en. I’m very happy to spread my thought to non-Japanese readers.