0

I'm trying to develop a real estate web app. I downloaded html/css theme from envato and they look great locally... not so much on my express server (running on my host machine).

I get this error

As soon as I take out

"var bootstrap = require('bootstrap');"

my website loads but website layout is off. Anyone else experience this problem before?

ea1995
  • 1
  • Sorry it was confusing, you want to use bootstrap on node js but made use of the npm package, would not it be better to use cdn or import the assets through the static folder? – Chance Jan 21 '19 at 01:56
  • with the CDN do I just have to include the urls in my html files? – ea1995 Jan 21 '19 at 02:53
  • Yes, just check which version your template uses to not break the style with a more current version. Cdn loads the many files faster than files in static folders. – Chance Jan 21 '19 at 04:06

1 Answers1

0

Require is a built-in function for Node.js to load modules. See What is this Javascript "require"? for more info about require.

But in short when you remove var bootstrap = require('bootstrap'), you are not allowing your code to access the bootstrap module thus removing the bootstrap styling for the app.

MNBS
  • 21
  • 2
  • I often see mention of the bootstrap CDN. is there a way to access the CDN without "var bootstrap = require('bootstrap');" ? I ask because when I include it, it breaks my web app and doesn't run at all. It reutns an error which says: TypeError: Cannot set property 'emulateTransitionEnd' of undefined – ea1995 Jan 21 '19 at 02:52