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
{{ message }}
Repository navigation
"Uncaught Error: define cannot be used indirect" when using jsonix in angular 6 #202
I am trying to import jsonix from an angular 6 project. It installs ok, but when I run ng serve I get the following error through the console
Uncaught Error: define cannot be used indirect
at push../node_modules/webpack/buildin/amd-define.js.module.exports (amd-define.js:2)
at Object.<anonymous> (jsonix.js:6103)
at Object../node_modules/jsonix/jsonix.js (jsonix.js:6129)
at __webpack_require__ (bootstrap:76)
at Object../src/app/app.component.ts (main.js:94)
at __webpack_require__ (bootstrap:76)
at Object../src/app/app.module.ts (app.component.ts:9)
at __webpack_require__ (bootstrap:76)
at Object../src/main.ts (main.ts:1)
at __webpack_require__ (bootstrap:76)
Basically, Jsonix dist is just one JS file. It has a more-or-less UMD-style wrapper to allow it run in Node.js, with RequireJS and AMD.
Ok, This does not work with Webpack because it probably has its own magic.
The quiestion is ultimately, what should Jsonix-all.js look like so that it works with Webpack? Here, I need your input. I have no experience with Webpack so I'll need help with this.
Thanks for your answer. I realise now that the question was duplicated indeed. I do not know right now how to fix the compatibility with webpack but I'll give it a thought.
I just want to point out that three months ago I had no problems using jsonix with angular 6 but since one of the last updates the problem appeared.
I'll research the subject a little.
Keep up the good work.
Hi guys.
@hugo and @alexey
I work at INPE in Brazil and we are using Jsonix ( thanks for that lib ).
We are using angular 5 and webpack 4. We had that problem but I solved (
just remove amdefine dependecy and work very fine).
You can see here: http://github.com/Terrabrasilis
Thanks a lot for Jsonix.
Regards.
Em Sáb, 22 de set de 2018 17:36, Alexey Valikov <notifications@github.com>
escreveu:
Activity
highsource commentedon Sep 22, 2018
I think this is duplicate of #171.
highsource commentedon Sep 22, 2018
Basically, Jsonix dist is just one JS file. It has a more-or-less UMD-style wrapper to allow it run in Node.js, with RequireJS and AMD.
Ok, This does not work with Webpack because it probably has its own magic.
The quiestion is ultimately, what should
Jsonix-all.jslook like so that it works with Webpack? Here, I need your input. I have no experience with Webpack so I'll need help with this.HugoJBello commentedon Sep 22, 2018
Thanks for your answer. I realise now that the question was duplicated indeed. I do not know right now how to fix the compatibility with webpack but I'll give it a thought.
I just want to point out that three months ago I had no problems using jsonix with angular 6 but since one of the last updates the problem appeared.
I'll research the subject a little.
Keep up the good work.
highsource commentedon Sep 22, 2018
Hm, that's strange.
If you figure out what the UMD wrapper should look like to work with Webpack, I'll be happy to fix this.
jether2011 commentedon Sep 22, 2018