Picture of Ludovic Bas
how to debug translate:export
by Ludovic Bas - Tuesday, 13 February 2018, 4:59 PM
 

Hello,

I have a problem with the command translate:export. It throws "cannot read property 'hasOwnProperty' of undefined" right after the _extractCourseData task. It seems that it cannot translate my own component. So how can I debug this task? And what should I know to make my component compatible with translation?

I already have a properties.schema which is inspired by the "graphic" component. My component is a comparison slider with 2 graphics (graphic1 and graphic2).

Picture of Matt Leathes
Re: how to debug translate:export
by Matt Leathes - Tuesday, 13 February 2018, 5:53 PM
 

Yeah I've been here myself, these sorts of things can be quite frustrating to debug.

I do remember that one time it happened to me it was down to the older version of quicknav being used in the course. If you're using that and it's the older version where it was an extension rather than a component then that's probably the cause. Let me know if so and I'll tell you the workaround.

 

Picture of Ludovic Bas
Re: how to debug translate:export
by Ludovic Bas - Tuesday, 13 February 2018, 10:21 PM
 

Thanks for your answer.

I've removed my comparison component and the export works. So it's definitely something inside the properties.schema file of my component I guess. What can interrupt the export process (my file is in attachment)?

Picture of Matt Leathes
Re: how to debug translate:export
by Matt Leathes - Wednesday, 14 February 2018, 6:50 PM
 

sorry for the slow reply, been busy with project work. can't see anything obviously wrong with that. could you share the actual JSON you've used for one of these from your components.json? just thinking there maybe a mismatch somewhere

Picture of Ludovic Bas
Re: how to debug translate:export
by Ludovic Bas - Wednesday, 14 February 2018, 7:57 PM
 

Here is the file. I've extracted the comparison-slider component only. Didn't find any mismatch myself but I must confess that I don't know where to look exactly.

Picture of Thomas Berger
Re: how to debug translate:export
by Thomas Berger - Thursday, 15 February 2018, 7:45 AM
 

Hello,

do you have a bower.json for you component? I am not sure if components need one to work with the translate task but I think extensions do.

To debug the grunt task as such I would recommend Visual Studio Code's debugger. 

Cheers

Thomas

Picture of Matt Leathes
Re: how to debug translate:export
by Matt Leathes - Thursday, 15 February 2018, 10:00 AM
 
To debug the grunt task as such I would recommend Visual Studio Code's debugger

Why didn't I think of that before?! That would have been so helpful last year.

Picture of Ludovic Bas
Re: how to debug translate:export
by Ludovic Bas - Thursday, 15 February 2018, 2:35 PM
 

Thank you very much, both of you. The bower.json of my custom component was missing this :

"displayName" : "Comparison-slider",
"component" : "comparison-slider",