i cant run templates in asp mvc 9
TypeError: Promise constructor cannot be invoked without 'new'
Replies (3)
Hi
It's a false alarm from the Visual Studio debugger.
To stop VS from breaking on it:
Tools > Options > Debugging > General > uncheck "Enable JavaScript debugging for ASP.NET (Chrome, Edge and IE)"
Or keep debugging on and mute these: Debug > Windows > Exception Settings > uncheck JavaScript Runtime Exceptions.
If something is genuinely not working on the page after that (a plugin not initialising, a broken widget), let me know what, and I'll look into it.
not work please send me new files that works please
Which Metronic version you're using (v8.3.3) demo 14
running on Visual Studio
The full error stack trace
<anonymous> [localhostê44360/assets/js/plugins.bundle.js] Line 64
at E:\Prj Web\ASP Net Cor MVC\Cources\Web Development in .Net 6 MVC\05. Prepare Project\Bookify - Section 5 End\Bookify - Section 5 End\Bookify.Web\wwwroot\assets\js\plugins.bundle.js(64)
s [localhostê44360/assets/js/plugins.bundle.js] Line 64
at E:\Prj Web\ASP Net Cor MVC\Cources\Web Development in .Net 6 MVC\05. Prepare Project\Bookify - Section 5 End\Bookify - Section 5 End\Bookify.Web\wwwroot\assets\js\plugins.bundle.js(64)
<anonymous> [localhostê44360/assets/js/plugins.bundle.js] Line 64
at E:\Prj Web\ASP Net Cor MVC\Cources\Web Development in .Net 6 MVC\05. Prepare Project\Bookify - Section 5 End\Bookify - Section 5 End\Bookify.Web\wwwroot\assets\js\plugins.bundle.js(64)
<anonymous> [localhostê44360/assets/js/plugins.bundle.js] Line 64
at E:\Prj Web\ASP Net Cor MVC\Cources\Web Development in .Net 6 MVC\05. Prepare Project\Bookify - Section 5 End\Bookify - Section 5 End\Bookify.Web\wwwroot\assets\js\plugins.bundle.js(64)
<anonymous> [localhostê44360/assets/js/plugins.bundle.js] Line 64
at E:\Prj Web\ASP Net Cor MVC\Cources\Web Development in .Net 6 MVC\05. Prepare Project\Bookify - Section 5 End\Bookify - Section 5 End\Bookify.Web\wwwroot\assets\js\plugins.bundle.js(64)
Hi,
Understanding
You're getting TypeError: Promise constructor cannot be invoked without 'new' when running Metronic templates in an ASP.NET MVC 9 environment. This is a known issue related to Visual Studio's JavaScript debugging and the Promise polyfill in plugins.bundle.js.
Solution
This error occurs when Visual Studio's JavaScript debugging injects code that conflicts with the Promise polyfill in Metronic's bundled plugins. Here are the proven fixes:
Option 1: Disable JavaScript Debugging in Visual Studio
- Go to Project Properties > Debugging
- Uncheck "Launch browser" (the option that auto-opens a browser when debugging)
- Run the application — the error should no longer appear
Option 2: Use dotnet CLI instead of Visual Studio debugger Run from your project root:
dotnet run watch
This bypasses Visual Studio's JavaScript debugging entirely.
Option 3: Remove the es6-shim require
In your plugins.js (source file), remove this line:
require("es6-shim/es6-shim.min.js");
Then rebuild assets.
Important: Make sure you're using the correct Metronic version assets:
- Metronic v8 (Bootstrap) — use v8 assets only, not v9
- Metronic v9 (Tailwind) — use v9 assets only, not v8
Mixing v8 and v9 JavaScript bundles causes compatibility issues.
Sources
- Known issue thread — detailed investigation with multiple solutions
- ASP.NET Core integration docs
Next Steps
If none of these solutions work, please share:
- Which Metronic version you're using (v8 or v9)
- Whether you're running through Visual Studio or dotnet CLI
- The full error stack trace
This will help us pinpoint the exact cause.
This reply was generated by AI. A human will follow up if needed.