Skip to content

istarkov/esm-log-issue-example

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

7 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

ESM cloud function log issue

Import inside ./routes.js file caused that some console.log commands stopped to output data at gcloud functions. Like console.log(Object), console.log(Array), console.log(JSON.stringify(Object, null, ' ' )) etc

Preinstall step

You need to have Google Cloud SDK istalled Intall instruction page for OSX

then gcloud init

Deploy

yarn deploy

Exec

Open https://europe-west1-esm-test-233714.cloudfunctions.net/esm-log

Logs

yarn logs

Logs are not updated immediately and you need to wait usually 20-60sec

Use other esm version

I havent found a way how to prevent cloud function to override node_modules folder so I placed esm folder from node_modules in sources and require it via relative path

Issue

Now in logs is

Function execution started
HELLO
Function execution took 40 ms, finished with status code: 200

Must be

Function execution started
HELLO
{ a: 1 }
{
 "a": 1
}
[ 1 ]
Function execution took 15 ms, finished with status code: 200

About

Esm log issue example

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published