FlexJS: Getting Uncaught type error

classic Classic list List threaded Threaded
16 messages Options
Reply | Threaded
Open this post in threaded view
|

FlexJS: Getting Uncaught type error

PKumar
Hi,

I have downloaded  the FlexJS nightly build and compile my examples but getting the following error:

Uncaught TypeError: Cannot read property 'apply' of undefined
    at MyInitialView.get (MyInitialView.js:385)
    at MyInitialView.org.apache.flex.core.ContainerBase.addedToParent (ContainerBase.js:185)
    at StyleExample.org.apache.flex.core.Application.addElement (Application.js:127)
    at StyleExample.org.apache.flex.core.Application.initialize (Application.js:277)
    at StyleExample.org.apache.flex.core.Application.start (Application.js:248)
    at index.html:179

This was working but stop working with nightly build. Please suggest.
Regards,
Prashant
Reply | Threaded
Open this post in threaded view
|

Re: FlexJS: Getting Uncaught type error

Alex Harui
Hard to say.  You might have to debug into it and tell us what was
undefined.

There might be more issues with Container than with Group so if you don't
need scrolling, try switching Containers to Group.

HTH,
-Alex

On 4/25/17, 12:02 PM, "PKumar" <[hidden email]> wrote:

>Hi,
>
>I have downloaded  the FlexJS nightly build and compile my examples but
>getting the following error:
>
>Uncaught TypeError: Cannot read property 'apply' of undefined
>    at MyInitialView.get (MyInitialView.js:385)
>    at MyInitialView.org.apache.flex.core.ContainerBase.addedToParent
>(ContainerBase.js:185)
>    at StyleExample.org.apache.flex.core.Application.addElement
>(Application.js:127)
>    at StyleExample.org.apache.flex.core.Application.initialize
>(Application.js:277)
>    at StyleExample.org.apache.flex.core.Application.start
>(Application.js:248)
>    at index.html:179
>
>This was working but stop working with nightly build. Please suggest.
>
>
>
>-----
>Regards,
>Prashant
>--
>View this message in context:
>https://na01.safelinks.protection.outlook.com/?url=http%3A%2F%2Fapache-fle
>x-users.2333346.n4.nabble.com%2FFlexJS-Getting-Uncaught-type-error-tp15112
>.html&data=02%7C01%7C%7C39dde4078231497ed3c408d48c0f2743%7Cfa7b1b5a7b34438
>794aed2c178decee1%7C0%7C0%7C636287444089569690&sdata=EsVv2w6Gq0GmodG0Z4w1v
>urTMjke%2BlUTj6dqfeGTPso%3D&reserved=0
>Sent from the Apache Flex Users mailing list archive at Nabble.com.

Reply | Threaded
Open this post in threaded view
|

Re: FlexJS: Getting Uncaught type error

Olaf Krueger
In reply to this post by PKumar
Hi,
this is a bit strange:
I can reproduce this error by compiling with FlashBuilder [1].
By using VSCode it works.

Cause this makes no sense to me I double checked that both really used the same SDK...

To make sure that there no side effects within my app code I reduced it to a test case with a Main.mxml file and an initial view that contains just a js:Label.

Probably I'm doing something wrong... but maybe this is still more helpful than confusing.

Olaf


[1] https://snag.gy/KegvoT.jpg
Reply | Threaded
Open this post in threaded view
|

Re: FlexJS: Getting Uncaught type error

Josh Tynjala
This looks suspiciously like a situation that I ran into a while back. In
Flash Builder, try deleting your project's output directory and build
(cleaning the project should take care of that). That should clear up the
error.

When you switch between different versions of FlexJS, you can get errors
like this because your output directory may end up containing a mix of JS
files from both versions of the SDK. I guess FlexJS doesn't delete the old
JS files with every build because that requires a longer build for all of
the file copying. So you need to remember to clean right after you update
your SDK.

- Josh

On Wed, Apr 26, 2017 at 7:01 AM, OK <[hidden email]> wrote:

> Hi,
> this is a bit strange:
> I can reproduce this error by compiling with FlashBuilder [1].
> By using VSCode it works.
>
> Cause this makes no sense to me I double checked that both really used the
> same SDK...
>
> To make sure that there no side effects within my app code I reduced it to
> a
> test case with a Main.mxml file and an initial view that contains just a
> js:Label.
>
> Probably I'm doing something wrong... but maybe this is still more helpful
> than confusing.
>
> Olaf
>
>
> [1] https://snag.gy/KegvoT.jpg
>
>
>
> --
> View this message in context: http://apache-flex-users.
> 2333346.n4.nabble.com/FlexJS-Getting-Uncaught-type-error-
> tp15112p15117.html
> Sent from the Apache Flex Users mailing list archive at Nabble.com.
>
Reply | Threaded
Open this post in threaded view
|

Re: FlexJS: Getting Uncaught type error

PKumar
I deleted bin folder and build project again. but getting same issue. I am using FlashBuilder4.7.  Please check the attached chrome console output.  

This issue is only reproducible if i am creating a separate view as "MyInitialView.mxml"  and  could not reproduce if i am keeping all my mxml inside main.mxml file. Please suggest.



Regards,
Prashant
Reply | Threaded
Open this post in threaded view
|

Re: FlexJS: Getting Uncaught type error

Olaf Krueger
In reply to this post by Josh Tynjala
It already feels like doing much more clean ups than compilations during app development :-))

In this case a project clean in combination with removing the bin dir works for me!

@Prashant
Do you have already tried the FB Project->clean... function?

Thanks,
Olaf

Reply | Threaded
Open this post in threaded view
|

Re: FlexJS: Getting Uncaught type error

PKumar
Yes , I have tried but no luck. This issue is only occuring if I am creating separate view as InitialView.mxml  and including it in main.mxml.

On 27-Apr-2017 1:30 AM, "OK [via Apache Flex Users]" <[hidden email]> wrote:
It already feels like doing much more clean ups than compilations during app development :-))

In this case a project clean in combination with removing the bin dir works for me!

@Prashant
Do you have already tried the FB Project->clean... function?

Thanks,
Olaf




If you reply to this email, your message will be added to the discussion below:
http://apache-flex-users.2333346.n4.nabble.com/FlexJS-Getting-Uncaught-type-error-tp15112p15123.html
To start a new topic under Apache Flex Users, email [hidden email]
To unsubscribe from Apache Flex Users, click here.
NAML

Regards,
Prashant
Reply | Threaded
Open this post in threaded view
|

Re: FlexJS: Getting Uncaught type error

Olaf Krueger
PKumar wrote
Yes , I have tried but no luck. This issue is only occuring if I am
creating separate view as InitialView.mxml  and including it in main.mxml.
I also had this issue during my tests but after a clean up and the removing of the bin the issue was gone...

Could you reproduce the issue by using a new FB test project?

Olaf
Reply | Threaded
Open this post in threaded view
|

Re: FlexJS: Getting Uncaught type error

PKumar
This post was updated on .
I have created the test demo but not working. If i am compiling demo with FlexJS 0.7.0 then it is working but if compiling with FlexJS 0.8.0 nightly build then  it is failing.

var arr = MyInitialView.superClass_.get__MXMLDescriptor.apply(this);

get__MXMLDescriptor is getting undefined.
Regards,
Prashant
Reply | Threaded
Open this post in threaded view
|

Re: FlexJS: Getting Uncaught type error

Alex Harui
Hi Prashant,

What is the top tag in MyInitialView?

-Alex

On 4/27/17, 11:43 AM, "PKumar" <[hidden email]> wrote:

>I have created the test demo but getting  not working. If i am compiling
>demo
>with FlexJS 0.7.0 then it is working but if compiling with FlexJS 0.8.0
>nightly build then  it is failing.
>
>var arr = MyInitialView.superClass_.*get__MXMLDescriptor*.apply(this);
>
>get__MXMLDescriptor is getting undefined.
>
>
>
>-----
>Regards,
>Prashant
>--
>View this message in context:
>https://na01.safelinks.protection.outlook.com/?url=http%3A%2F%2Fapache-fle
>x-users.2333346.n4.nabble.com%2FFlexJS-Getting-Uncaught-type-error-tp15112
>p15132.html&data=02%7C01%7C%7C6558ba3f563e44377ef208d48d9edce9%7Cfa7b1b5a7
>b34438794aed2c178decee1%7C0%7C0%7C636289160854039320&sdata=MCfq9SbwUGr9SFZ
>37bIwzxZlU5V4z4fAZLBbYPU5eYg%3D&reserved=0
>Sent from the Apache Flex Users mailing list archive at Nabble.com.

Reply | Threaded
Open this post in threaded view
|

Re: FlexJS: Getting Uncaught type error

PKumar
My initial view is based on <js:View  > based and my old demos which was working  now with latest build stopped working.

On 28-Apr-2017 2:44 AM, "Alex Harui [via Apache Flex Users]" <[hidden email]> wrote:
Hi Prashant,

What is the top tag in MyInitialView?

-Alex

On 4/27/17, 11:43 AM, "PKumar" <[hidden email]> wrote:

>I have created the test demo but getting  not working. If i am compiling
>demo
>with FlexJS 0.7.0 then it is working but if compiling with FlexJS 0.8.0
>nightly build then  it is failing.
>
>var arr = MyInitialView.superClass_.*get__MXMLDescriptor*.apply(this);
>
>get__MXMLDescriptor is getting undefined.
>
>
>
>-----
>Regards,
>Prashant
>--
>View this message in context:
>https://na01.safelinks.protection.outlook.com/?url=http%3A%2F%2Fapache-fle
>x-users.2333346.n4.nabble.com%2FFlexJS-Getting-Uncaught-type-error-tp15112
>p15132.html&data=02%7C01%7C%7C6558ba3f563e44377ef208d48d9edce9%7Cfa7b1b5a7
>b34438794aed2c178decee1%7C0%7C0%7C636289160854039320&sdata=MCfq9SbwUGr9SFZ
>37bIwzxZlU5V4z4fAZLBbYPU5eYg%3D&reserved=0
>Sent from the Apache Flex Users mailing list archive at Nabble.com.



If you reply to this email, your message will be added to the discussion below:
http://apache-flex-users.2333346.n4.nabble.com/FlexJS-Getting-Uncaught-type-error-tp15112p15133.html
To start a new topic under Apache Flex Users, email [hidden email]
To unsubscribe from Apache Flex Users, click here.
NAML
Regards,
Prashant
Reply | Threaded
Open this post in threaded view
|

Re: FlexJS: Getting Uncaught type error

Alex Harui
Hi Prashant,

Send me the bad SWF off-list.

Thanks,
-Alex

On 4/27/17, 9:39 PM, "PKumar" <[hidden email]> wrote:

>My initial view is based on <js:View  > based and my old demos which was
>working  now with latest build stopped working.
>
>On 28-Apr-2017 2:44 AM, "Alex Harui [via Apache Flex Users]" <
>[hidden email]> wrote:
>
>> Hi Prashant,
>>
>> What is the top tag in MyInitialView?
>>
>> -Alex
>>
>> On 4/27/17, 11:43 AM, "PKumar" <[hidden email]
>> <http:///user/SendEmail.jtp?type=node&node=15133&i=0>> wrote:
>>
>> >I have created the test demo but getting  not working. If i am
>>compiling
>> >demo
>> >with FlexJS 0.7.0 then it is working but if compiling with FlexJS 0.8.0
>> >nightly build then  it is failing.
>> >
>> >var arr = MyInitialView.superClass_.*get__MXMLDescriptor*.apply(this);
>> >
>> >get__MXMLDescriptor is getting undefined.
>> >
>> >
>> >
>> >-----
>> >Regards,
>> >Prashant
>> >--
>> >View this message in context:
>> >https://na01.safelinks.protection.outlook.com/?url=
>> http%3A%2F%2Fapache-fle
>>
>>>x-users.2333346.n4.nabble.com%2FFlexJS-Getting-Uncaught-type-error-tp151
>>>12
>>
>>
>>>p15132.html&data=02%7C01%7C%7C6558ba3f563e44377ef208d48d9edce9%7Cfa7b1b5
>>>a7
>>
>>
>>>b34438794aed2c178decee1%7C0%7C0%7C636289160854039320&sdata=MCfq9SbwUGr9S
>>>FZ
>>
>> >37bIwzxZlU5V4z4fAZLBbYPU5eYg%3D&reserved=0
>> >Sent from the Apache Flex Users mailing list archive at Nabble.com.
>>
>>
>>
>> ------------------------------
>> If you reply to this email, your message will be added to the discussion
>> below:
>>
>>https://na01.safelinks.protection.outlook.com/?url=http%3A%2F%2Fapache-fl
>>ex-users.2333346.n4.nabble.com%2FFlexJS-&data=02%7C01%7C%7C5fb8b48b575942
>>916aa908d48df22ddc%7Cfa7b1b5a7b34438794aed2c178decee1%7C0%7C0%7C636289518
>>672040382&sdata=iI3%2Fw9mX4EXFak26qfGyQjL3LdOwEvFye1Seq3fBjb4%3D&reserved
>>=0
>> Getting-Uncaught-type-error-tp15112p15133.html
>> To start a new topic under Apache Flex Users, email
>> [hidden email]
>> To unsubscribe from Apache Flex Users, click here
>>
>><https://na01.safelinks.protection.outlook.com/?url=http%3A%2F%2Fapache-f
>>lex-users.2333346.n4.nabble.com%2Ftemplate%2FNamlServlet.jtp%3Fmacro%3Dun
>>subscribe_by_code%26node%3D1%26code%3DcHJhc2hha3VtYXJAZ21haWwuY29tfDF8LTU
>>0MTcyMzE2NA&data=02%7C01%7C%7C5fb8b48b575942916aa908d48df22ddc%7Cfa7b1b5a
>>7b34438794aed2c178decee1%7C0%7C0%7C636289518672040382&sdata=38VbyChKZF864
>>7D2Zn89Tm9o%2FnexC6kB3ucAYkF4V5Y%3D&reserved=0==>
>> .
>> NAML
>>
>><https://na01.safelinks.protection.outlook.com/?url=http%3A%2F%2Fapache-f
>>lex-users.2333346.n4.nabble.com%2Ftemplate%2FNamlServlet.jtp%3Fmacro%3Dma
>>cro_viewer%26id%3Dinstant_html%2521nabble%253Aemail.naml%26base%3Dnabble.
>>naml.namespaces.BasicNamespace-nabble.view.web.template.NabbleNamespace-n
>>abble.view.web.template.NodeNamespace%26breadcrumbs%3Dnotify_subscribers%
>>2521nabble%253Aemail.naml-instant_emails%2521nabble%253Aemail.naml-send_i
>>nstant_email%2521nabble%253Aemail.naml&data=02%7C01%7C%7C5fb8b48b57594291
>>6aa908d48df22ddc%7Cfa7b1b5a7b34438794aed2c178decee1%7C0%7C0%7C63628951867
>>2040382&sdata=sSPEQXb1tqCDQVBMGo4nx%2BcomEfuGDrxOuhzhoNOVhk%3D&reserved=0
>>>
>>
>
>
>
>
>-----
>Regards,
>Prashant
>--
>View this message in context:
>https://na01.safelinks.protection.outlook.com/?url=http%3A%2F%2Fapache-fle
>x-users.2333346.n4.nabble.com%2FFlexJS-Getting-Uncaught-type-error-tp15112
>p15134.html&data=02%7C01%7C%7C5fb8b48b575942916aa908d48df22ddc%7Cfa7b1b5a7
>b34438794aed2c178decee1%7C0%7C0%7C636289518672040382&sdata=j9M2P89%2Bz30hI
>pr2wxq%2B37ap5CULYA%2F2QvunA8%2F0xk8%3D&reserved=0
>Sent from the Apache Flex Users mailing list archive at Nabble.com.

Reply | Threaded
Open this post in threaded view
|

Re: FlexJS: Getting Uncaught type error

PKumar
Aelx,

SWF side is working ok , problem is  only JS side. Following is my code:

<?xml version="1.0" encoding="utf-8"?>
<js:Application xmlns:fx="http://ns.adobe.com/mxml/2009"
                                xmlns:js="library://ns.apache.org/flexjs/basic" xmlns:local="*">
        <js:valuesImpl>
                <js:SimpleCSSValuesImpl />
        </js:valuesImpl>
       
        <js:initialView>
                <local:MyInitialView />
        </js:initialView>
</js:Application>

MyInitialView.xml

<?xml version="1.0" encoding="utf-8"?>
<js:View xmlns:fx="http://ns.adobe.com/mxml/2009"
                 xmlns:js="library://ns.apache.org/flexjs/basic">
        <js:beads>
                <js:ViewDataBinding />
        </js:beads>
        <js:Label text="Hello FlexJS" />
</js:View>
Regards,
Prashant
Reply | Threaded
Open this post in threaded view
|

Re: FlexJS: Getting Uncaught type error

piotrz
Hi Prashant,

This kind of project build for me without the problem. Could you package to zip your project and post here link. I will try to build it by maven and try it in Moonshine or VSCode.

Thanks,
Piotr
Apache Flex PMC
piotrzarzycki21@gmail.com
Reply | Threaded
Open this post in threaded view
|

Re: FlexJS: Getting Uncaught type error

PKumar
I switch to VCode editor and issue  disappear.
Regards,
Prashant
Reply | Threaded
Open this post in threaded view
|

Re: FlexJS: Getting Uncaught type error

piotrz
Good choice :)
Apache Flex PMC
piotrzarzycki21@gmail.com