[solved] Trying to diagnose plugin minify error

For developers using the Construct 2 Javascript SDK

Post » Sat Sep 09, 2017 9:50 am

I am making a behavior plugin. All works well when the export is un-minified. If I minify the export then I receive the following error:

Code: Select all
TypeError: q is not a constructor

The "q" corresponds to "behavior_ctor" in the c2runtime.js when un-minified:

Code: Select all
Line 4420ish
if (!behavior_plugin)
               behavior_plugin = new behavior_ctor(this);
               behavior_plugin.my_types = [];                  // types using this behavior
               behavior_plugin.my_instances = new cr.ObjectSet();    // instances of this behavior
               if (behavior_plugin.onCreate)

I hope that this is enough info. If anyone has any idea where I should focus my efforts then that would be very much appreciated. I imagine that I am missing something obvious here... I am about to embark on a long process of rebuilding my plugin from scratch to see what causes the export to break. But I need to sleep! :)


Solved. Apparently you cannot preserve the name of your plugin like this: ["myplugin"].
A big fan of JavaScript. Image Image
Posts: 2,355
Reputation: 52,204

Return to Javascript SDK

Who is online

Users browsing this forum: No registered users and 0 guests