Symfony7 Metronic 8.2.9 AssetMapper - TypeError:Cannot set properties of undefined (setting ‘moment’)
Hello,
I’m encountering this error with Symfony 7 and AssetMapper in the plugin.bundle.js file. Webpack is no longer recommended for Symfony 7. I took the plugin.bundle.js from demo 2 of the HTML version. How can I resolve this issue?
Thank you.
Replies (1)
Hi Damien
You can try the following steps:
Run the following command to install the moment module in your project:
npm install --save moment
Update your assets/manifest.json file to include the paths for plugin.bundle.js and moment.js. For example:
{
"plugin.bundle.js": "path/to/plugin.bundle.js",
"moment.js": "node_modules/path/to/moment.js"
} Make sure that moment.js is loaded before plugin.bundle.js in your template file.
If you still encounter issues, let me know!