jgthms / bulma-start

Start package for Bulma
https://www.npmjs.com/package/bulma-start
MIT License
276 stars 82 forks source link

bulma-start with bulma-extensions: "ReferenceError: require is not defined" #13

Closed amphrony closed 5 years ago

amphrony commented 5 years ago

Hello, Bulma/JS newbie here... trying to build a simple site the "npm way", starting with bulma-start and adding a bulma-extension component. I doubt this a bulma-extension issue, and since bulma-start seems newbie-oriented, I figured I should start here :)

Steps to reproduce issue:

Browse to index.html... Great! "Hello Bulma" is up and running... Now, let's add a bulma-extension:

I have also tried installing/importing bulma-calendar. Both extensions result in the same error from browser console: ReferenceError: require is not defined.

I can see that there is, indeed, a require() call being compiled into lib/main.js by Babel for the imported bulma extension.

Some researching leads me to think this might have to do with Babel, babel-preset-env, and babel-preset-es2015-ie. Found this https://www.npmjs.com/package/babel-plugin-add-module-exports but following the instructions there did not help. Also read that maybe webpack or browserify could address this, but seems a little excessive... I will keep trying to adjust Babel and see what happens.

Any ideas what I could be doing wrong? Maybe .babelrc needs modification?

amphrony commented 5 years ago

probably not Babel

rmoskal commented 5 years ago

I have this same problem. I guess I'll just stick with parcel or web pack,

TWDickson commented 4 years ago

Has there been any updates to this? I'm getting the same error as well and not sure where to start.