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.

Can not resolve config constant / Access of undefined property

See original GitHub issue

Hi! I finally got project alive and working in VS Code. Yay! Thank you for the all hard work! This is extension is really cool!

The last problem I have is with compiler definitions. When I define them like this:

"define":
[
    {
    "name": "CONFIG::funcName",
    "value": "'functionName'"
 }
]

Then I receive the Can not resolve config constant 'funcName' error when I use CONFIG::funcName in the code. My code looks like someClass.someMethod( CONFIG::funcName ). When I define it as

"additionalOptions": "-define=CONFIG::funcName,'functionName'"

I receive a lot of crashes like

	at org.apache.royale.compiler.internal.definitions.AmbiguousDefinition.resolveAmbiguities(AmbiguousDefinition.java:130)
	at org.apache.royale.compiler.internal.scopes.ASScopeCache.findProperty(ASScopeCache.java:167)
	at org.apache.royale.compiler.internal.scopes.ASScope.findProperty(ASScope.java:1428)
	at org.apache.royale.compiler.internal.definitions.references.LexicalReference.resolve(LexicalReference.java:72)
	at org.apache.royale.compiler.internal.definitions.DefinitionBase.resolveType(DefinitionBase.java:1062)
	at org.apache.royale.compiler.internal.definitions.DefinitionBase.resolveType(DefinitionBase.java:1102)
	at org.apache.royale.compiler.internal.definitions.DefinitionBase.resolveType(DefinitionBase.java:884)
	at org.apache.royale.compiler.internal.definitions.AmbiguousDefinition.resolveAmbiguousVariableDefinitions(AmbiguousDefinition.java:208)

and then Access of possibly undefined property 'CONFIG' error.

What do you think can be the source of these problems?

Issue Analytics

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

github_iconTop GitHub Comments

1reaction
joshtynjalacommented, May 17, 2019

I added an additional check to prevent the crash, if something similar pops up in the future. I also fixed the bug that caused the crash when parsing additionalOptions. These fixes will be in the next update.

0reactions
jnpatrick99commented, May 25, 2019

Thank you very much! Seems to be working fine now!

Read more comments on GitHub >

github_iconTop Results From Across the Web

Access of undefined property CONFIG:: - Stack Overflow
The error: "Access of undefined property LOGGING." ... To be honest I am a ActionScript noob, so I am not sure what to...
Read more >
undefined - JavaScript - MDN Web Docs - Mozilla
The global undefined property represents the primitive value undefined. It is one of JavaScript's primitive types.
Read more >
Avoiding those dang cannot read property of undefined errors
Uncaught TypeError : Cannot read property 'foo' of undefined. ​ The dreaded error we all hit at some point in JavaScript development.
Read more >
Uncaught TypeError: Cannot read property of undefined
If you get undefined error, you need to make sure that which ever variables throws undefined error, is assigned a value to it....
Read more >
Constants - Manual - PHP
As the name suggests, that value cannot change during the execution of the ... So yeah, undefined global constant when accessed directly will...
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