Get 2025 Templates Mega Bundle!$1000 worth of 19 Bootstrap HTML, Vue & React Templates + 3 Vector Sets for just $99
Get for 99$

Symfony7 Metronic 8.2.5 AssetMapper - TypeError:Cannot set properties of undefined (setting ‘moment’)


As I mentioned in a previous query, I'm working with Symfony7 and in the latest updates (since Symfony 6.3) AssetMapper is recommended over Webpack. Given the problems I'm having with Metronic 8 in Symfony 7, I've been testing with AssetMapper and in principle everything starts to work (at least apparently). Setting up AssetMapper is quite easy and you only have to import the different .js in the app.js file. However, I get a problem with the "plugins.bundle.js" in the console. It says: "TyperError: Cannot set properties of undefined (setting 'moment')". I've seen in the comments about it that it would be solved with webpack, but I'm trying to avoid webpack and make the application lighter, how can it be solved.

How can I solve the problem, is it necessary to import and call some library that is not included in the asset folder of the demo?

Thanks.


Text formatting options
Submit
Here's a how to add some HTML formatting to your comment:
  • <pre></pre> for JS codes block
  • <pre lang="html"></pre> for HTML code block
  • <pre lang="scss"></pre> for SCSS code block
  • <pre lang="php"></pre> for PHP code block
  • <code></code> for single line of code
  • <strong></strong> to make things bold
  • <em></em> to emphasize
  • <ul><li></li></ul>  to make list
  • <ol><li></li></ol>  to make ordered list
  • <h3></h3> to make headings
  • <a></a> for links
  • <img> to paste in an image
  • <blockquote></blockquote> to quote somebody
  • happy  :)
  • shocked  :|
  • sad  :(

Replies (1)


Hi Restituto Vaño,

Here are some steps you can try:

Please copy plugins.bundle.js from the HTML version demo1, into your Symfony project. Let's see if the plugin file works.

Try to rebuild assets with webpack. Inside the folder symfony/starterkit/_keenthemes/tools, run these commands:

npm install
npm run build


The file symfony/starterkit/public/assets/plugins/global/plugins.bundle.js will be regenerated. Try to use it with your AssetMapper

Thank you


Text formatting options
Submit
Here's a how to add some HTML formatting to your comment:
  • <pre></pre> for JS codes block
  • <pre lang="html"></pre> for HTML code block
  • <pre lang="scss"></pre> for SCSS code block
  • <pre lang="php"></pre> for PHP code block
  • <code></code> for single line of code
  • <strong></strong> to make things bold
  • <em></em> to emphasize
  • <ul><li></li></ul>  to make list
  • <ol><li></li></ol>  to make ordered list
  • <h3></h3> to make headings
  • <a></a> for links
  • <img> to paste in an image
  • <blockquote></blockquote> to quote somebody
  • happy  :)
  • shocked  :|
  • sad  :(
Text formatting options
Submit
Here's a how to add some HTML formatting to your comment:
  • <pre></pre> for JS codes block
  • <pre lang="html"></pre> for HTML code block
  • <pre lang="scss"></pre> for SCSS code block
  • <pre lang="php"></pre> for PHP code block
  • <code></code> for single line of code
  • <strong></strong> to make things bold
  • <em></em> to emphasize
  • <ul><li></li></ul>  to make list
  • <ol><li></li></ol>  to make ordered list
  • <h3></h3> to make headings
  • <a></a> for links
  • <img> to paste in an image
  • <blockquote></blockquote> to quote somebody
  • happy  :)
  • shocked  :|
  • sad  :(