i cant run templates in asp mvc 9
TypeError: Promise constructor cannot be invoked without 'new'
Replies (1)
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.