Quantcast
Channel: Active questions tagged blazor - Stack Overflow
Viewing all articles
Browse latest Browse all 4839

Blazor.Bootstrap Overrides Existing Behavior

$
0
0

I have a site that uses JQuery and Bootstrap that has worked for a while.I have added some Blazor WASM components to the mix. These, so far, have worked well.I attempted to introduce Blazor.Bootstrap to the mix and I am running into some issues.

When I add the Blazor.Bootstrap, I get an error that "bootstrap" is not defined, here:enter image description here

I am packaging bootstrap, jquery and all of that with webpack.If I try to expose this bootstrap variable, I run into a catch-22.

If I add the following to my main TS file, Blazor.Bootstrap will work but then I get errors in the main site (such as drop down nav menus stop working).

window.bootstrap = require('bootstrap/dist/js/bootstrap.bundle.min.js');

I have tried to expose the bootstrap variable via webpack by using the webpack.ProvidePlugin (which I use for jquery). Adding the following results in no change to my packaged files.

"window.bootstrap": 'bootstrap',    "bootstrap": 'bootstrap',

Any ideas how to get out of this catch-22?


Viewing all articles
Browse latest Browse all 4839

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>