Related to the above error.
I have already read the threads below, and I believe that they have a common issue.
https://devs.keenthemes.com/question/metronic-theme-library-throws-an-exception
https://devs.keenthemes.com/question/metronic-v8037-sourcemaps-not-working-as-expected
https://devs.keenthemes.com/question/javascript-error-in-pluginsbundlejs
My development environment is ASP.NET Core 8. I have already implemented a project using the Metronic demo 37 theme, and everything was okay.
I started a new project with the latest theme update, which is where the problem began.
Things in programming cannot go randomly, and I know that for every issue, there is a reason.
I spent hours attempting to solve a problem that was hard to debug.
I follow the Metronic documentation about how to install the assets.
At the beginning, I just copied and pasted the files from wwwroot, which should work (and this is actually okay), but I am still receiving the exception
"TypeError: Promise constructor cannot be invoked without 'new'" in plugins.bundle.js
Even though I had duplicated the previous project setup, the issue persisted because I was looking for a quick fix.
I enabled verbose debugging and noticed that before the exception, there was an error saying “Could not read source map for…”.
Then I consider checking and switching browsers. I use Mozilla instead of Chrome. Still, I'm facing the same error, which doesn't make sense to me. BUT NOT in a new window.
This problem relates to the “Enable JavaScript source maps” setting in the browser inspector. The option was always enabled.
The source maps are connected to paths and security.
The issue was that my project's debug options had the default setting to launch a new browser when debugging. However, the problem was solved when I used an existing open browser.
Resolution: Remove the option in Project Properties -> Debugging: Open debug launch profiles UI and uncheck the option for Launch browser (indicating that the web browser should automatically launch when debugging the project).
There's no need to elaborate further on the source of the problem.
Having the Metronic team reproduce it and verify potential further errors is beneficial.
I hope to help you save time.
Hi
Thank you for your thorough investigation and for sharing the solution. I've tested the ASP.NET Core starter kit and confirmed your findings. We will fix the missing map files.
Since you're working with demo 37 (Metronic v8.3.2), using assets from Metronic v9.2.7 will cause compatibility issues. Metronic v8 and v9 have different architectures (Bootstrap vs Tailwind CSS), and their JavaScript bundles are not interchangeable.
For demo 37 (Metronic v8.3.2), make sure you're using Metronic v8.3.2 assets only
Download the correct demo package from Metronic Downloads by verifying your purchase code
Rebuild assets using the Gulp build system in the _keenthemes/tools folder:
cd _keenthemes/tools
npm install
gulp --demo37Hi,
Yes, I am using the right one.
Good luck, thanks.
Hi,
Apologies for the late reply.
Could you please specify which version of Metronic you are using?
I recall that this issue was resolved in a previous release, so updating to the latest version should fix it.
Also, are you running the starter app through Visual Studio or the dotnet cli?
Regards,
Lauris Stepanovs,
Keenthemes Support Team
Hi,
No worries.
I have downloaded the latest Metronic version 9.2.7.
However, I am working on demo 37, where the most recent version is 8.3.2.
However, even when I used the asset from the most recent version, I still encountered the same error.
If you need more information, do not hesitate to ask me.
Sincerely,
John P.
3Inventors.com