question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Global variables are undefined when running local invoke

See original GitHub issue
Resources:
  GithubPushes:
    Type: AWS::Serverless::Function
    DependsOn:
      - Stream
    Properties:
      Runtime: nodejs8.10
      Description: >-
        This will verify that the incoming data is from Github and hashed with the key
        we are using for this environment
      Environment:
        Variables:
          SECRET: !Sub ${Secret}

works fine when I run

SECRET=foo sam local invoke "GithubPushes" -e fixtures/data.json

but if I move that to Globals then this becomes “undefined”

Issue Analytics

  • State:closed
  • Created 5 years ago
  • Comments:6 (3 by maintainers)

github_iconTop GitHub Comments

github_iconTop Results From Across the Web

Global variables are undefined when running local invoke #380
Global variables are undefined when running local invoke #380 ... SECRET=foo sam local invoke "GithubPushes" -e fixtures/data.json.
Read more >
Why a variable defined global is undefined? - Stack Overflow
So the local variable's value is undefined before that line, and has a value after, but neither one are touching the global variable....
Read more >
Why can't I access global variables inside my function in ...
create a new local variable with the same name as globalVariable. globalVariable and give it a value. Log this new local variable. You'd...
Read more >
Javascript global variable is undefined,why? - CodeProject
Here variable declared but not set value. First you need to set value either by calling veg7() function or veg10() function, then you...
Read more >
Detecting Undefined Variables - lua-users wiki
Reads from and writes to undefined globals can be detected when they happen, at run-time. These approaches operate by overriding the __index ...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found