You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
It throws this compile error:
src/externs/Semantic.hx:4: lines 4-30 : JQuery class is already built before inserting plugin. Most likely due to missing
compiler option: --macro js.jquery.Config.addPlugin('externs.Semantic')
The terminal process terminated with exit code: 1
The problem is the import js.jquery.JQuery; statements in the extern modules. One extern module importing JQuery forces the compiler to build JQuery, so the other extern can no longer inject fields into JQuery.
The solution is simply to remove the import statements. You can still use JQuery (no need to use js.jquery.JQuery) in the extern body, because the extern fields are only typed after they are "pasted" into the JQuery class. Since JQuery is in js.jquery, you can reference any types in js.jquery without using fully-qualified names.
In fact, currently import statements are not supported in the plugin extern modules... I will have to think about how to support that. At the moment, please use fully-qualified names for any other types not existed in top-level or js.jquery.
Andy,
When you have to import more than 1 Jquery plugin in the hxml file, it fails:
(with only 1 plugin it works)
-lib jQueryExtern
-cp src
-js bin/DataTables.js
-main Main
--macro js.jquery.Config.addPlugin('externs.DataTable')
--macro js.jquery.Config.addPlugin('externs.Semantic')
It throws this compile error:
src/externs/Semantic.hx:4: lines 4-30 : JQuery class is already built before inserting plugin. Most likely due to missing
compiler option: --macro js.jquery.Config.addPlugin('externs.Semantic')
The terminal process terminated with exit code: 1
Sample project:
https://github.com/mmauri/DataTablesSample/
Thanks for your help!
The text was updated successfully, but these errors were encountered: