Comments (5)
Hey @unxavi, thanks for the detailed report. Sorry to hear you encountered this issue. I’m trying to reproduce this locally, but so far I haven’t encountered the same behavior. I’m able to load the environment variables during testing.
I created this repo to try and replicate this, let me know in case I may have missed anything or made a mistake in the setup. By any chance, if you could provide an MCVE, please share it as it would help us narrow down the cause of the issue.
Also, could you share your firebase-debug.log
file? It contains a detailed log that we can use to check what caused the issue. Please remove any personal identifiable information(PII) before sharing the file.
from firebase-tools.
Hi @aalej thanks for your response. Maybe is me who is making something wrong.
I have realize that using fetch
api is working as expected. I was using node16 from before and I was making a mock for the request and response (I will try to provide you an example with this later on) and that way the helper
functions doesn't seem to see the env variables.
But anyways I have made a pull request aalej/issues-6871#1 on your repository of a failing test, the case would be of setting up for example a service to send emails and unit test it. You can see that my helper
test does not load the value of the env files.
from firebase-tools.
The repro doesn't reproduce a failure as described. The actual test against the function passes I can even confirm it with your log statement:
console.log
Hello message from local! I am a function. From your demo project with clientId ClientId123
The failing test is trying to load the utility method directly in the jest process, which doesn't have the params injected.
from firebase-tools.
Hey @unxavi, I tried to reproduce this issue again after merging the PR you created(thanks for submitting that). Similar to what’s mentioned above, it looks like the test is failing because it’s trying to access a parameterized variable outside a Cloud Function's runtime and execution.
Since this currently looks like it’s working as intended, I’m going to go ahead and close the issue. However, if you feel like the current repro we have may be different from the issue you’re encountering, feel free to ask this to be reopened and share an MCVE with us so that we can investigate further.
from firebase-tools.
@aalej I understand that and if I found anything else I will get back to you.
The thing is that the "old" system "Environment configuration" using the config()
which was the recommended way, that use to work correctly doing this kind of tests where you don't pass through the cloud function itself. Now migrating a big project from the old recommended way to the new way it's pain.
from firebase-tools.
Related Issues (20)
- Nuxt3 with Web Frameworks fails to init or deploy - Cannot create property 'overrides' on string HOT 1
- Incorrect Path Formatting in Firebase-Tools on Windows with Version 13.11.3 and Above HOT 1
- I am getting this error when I am running firebase deploy HOT 1
- icons not showing after deploying it in to firebase also images from assets folder and also network imaegs not working WTF happend to you guys . you guys are making me to feel to leave firebase and flutter HOT 5
- Firebase hosted website not loading images `13.11.3` and onwards HOT 3
- Datastore emulator with arg --use-firestore-in-datastore-mode fails when multiple values are passed as Array with IN filter HOT 5
- package.json indicates an outdated version of firebase-functions. HOT 2
- Web FontManifest Missing on hosting even present under firebase assets HOT 2
- Hosting deploy broken in version 13.11.4 HOT 2
- Firebase Storage Triggers "onObjectFinalized" when creating a "folder" in the Emulator UI. HOT 2
- Unhandled error cleaning up build images. This could result in a small monthly bill if not corrected. HOT 4
- Blank Page displayed Flutter App hosted with Firebase Hosting on rewrite HOT 3
- Emulator indicating MORE_RESULTS_AFTER_LIMIT with NOT_EQUAL query regardless of more results or not HOT 2
- Bugreport HOT 2
- lSSUE HOT 1
- Allow Firestore emulator to persist data between restarts HOT 1
- Unable to Emulate or Deploy with Firestore in Python HOT 4
- Vulnerability with ws dependency
- Unsupported value type VECTOR using `affectedKeys` and `VectorValue` HOT 1
- Have Firestore support index files to validate indexes HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from firebase-tools.