Hello, folks!
I've been using Keen 2 for a while and when I updated my Rails version from 6 to 7, I decided to move from webpack to importmaps. JavaScript there is written in a modular way and was written like that for a long time.
When I did that with Keen 2, there were no problems. The application.js would just import the global necessary bundles of Keen 2 like this:
import "plugins/global/plugins.bundle"
import "plugins/custom/prismjs/prismjs.bundle"
import "js/scripts.bundle"
Uncaught TypeError: Cannot set properties of undefined (setting 'moment')
Uncaught TypeError: searchObject.on is not a function
Hi Karolis SakaviÄius
Sorry for the delay. Glad that you have resolved it
I hope this issue can help others as well.
Thanks
Resolved. Building with webpack makes everything ESM compatible. \o/
I can't edit a message for some reason but
"I tried to work around the problem by putting those scripts inside of a , like in an example but then I get another error:"
is
"I tried to work around the problem by putting those scripts inside of a body tag, like in an example but then I get another error:"