Skip to content

Vue.js 2.1 render trouble #45

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
lkielinski opened this issue Dec 15, 2016 · 23 comments
Closed

Vue.js 2.1 render trouble #45

lkielinski opened this issue Dec 15, 2016 · 23 comments

Comments

@lkielinski
Copy link

Hi,

there is some troubles with vue.js in 2.1 version. I got the error:
Vue warn]: Error when rendering component <bNavbar>: vue.js?3de6:2963 Uncaught ReferenceError: _h is not defined(…)

I rollback to vuejs 2.0.8 for now and everything works fine.

@sn0rcha
Copy link

sn0rcha commented Dec 16, 2016

I have the same problem as well on any component.

@pterk
Copy link
Contributor

pterk commented Dec 16, 2016

This is related to #44. @pi0 just merged it so I think it will be fixed in the next release. In the mean time you can add the dependency yourself and then rebuild bootstrap-vue (if you use webpack v2)

@mathlef0u
Copy link
Contributor

mathlef0u commented Dec 18, 2016

I just tested, and i've got the same error with the last version of bootstrap-vue (i rebuilded), i'll investigate

Edit : I found a solution, i'll make a pull request about it next week ;)

@cagartner
Copy link

same here, wainting for yours pull-request 👍

@yasirhantoush
Copy link

same here, I just used vue-cli lwith bootstrap-vue but failed for same error, what is the fix for this?

@w550
Copy link

w550 commented Dec 21, 2016

加油 解BUG

@mathlef0u
Copy link
Contributor

我今天纠正 !

@w550
Copy link

w550 commented Dec 21, 2016

赞👍

mathlef0u added a commit to mathlef0u/bootstrap-vue that referenced this issue Dec 21, 2016
mathlef0u added a commit that referenced this issue Dec 22, 2016
Fixed Vue.js 2.1 render trouble #45
@mathlef0u
Copy link
Contributor

Hey mates, i fixed the issue in my last commit, so please try to rebuild and give me your feedback

@fabien-lg
Copy link

Hello,
I've rebuild and tested and it works for me.
The «Uncaught ReferenceError: _h is not defined(…)» is gone.
Thanks!

@mathlef0u
Copy link
Contributor

Great ! Thanks @fabien-lg i can close the issue

@OmgImAlexis
Copy link

If you haven't could you please update npm and bump the version number.

@andrzejkupczyk
Copy link

@fabien-lg , @mathlet0x , I tried to rebuild but UglifyJS caught these errors:

yarn run v0.18.1
$ cd scripts && ./build 
Building commonjs version
Hash: c3e74280605a7a6ca3e0                                                             
Version: webpack 2.1.0-beta.25
Time: 6155ms
                     Asset    Size  Chunks             Chunk Names
    bootstrapVue.common.js  190 kB       0  [emitted]  bootstrapVue
bootstrapVue.common.js.map  250 kB       0  [emitted]  bootstrapVue
    + 113 hidden modules

ERROR in bootstrapVue.common.js from UglifyJs
SyntaxError: Unexpected token: name (text) [./utils/helpers.js:5,0][bootstrapVue.common.js:79,6]
Building browser version
Hash: 834ffdd4567a81cc64ab                                                             
Version: webpack 2.1.0-beta.25
Time: 6024ms
              Asset    Size  Chunks             Chunk Names
    bootstrapVue.js  190 kB       0  [emitted]  bootstrapVue
bootstrapVue.js.map  250 kB       0  [emitted]  bootstrapVue
    + 113 hidden modules

ERROR in bootstrapVue.js from UglifyJs
SyntaxError: Unexpected token: name (text) [./utils/helpers.js:5,0][bootstrapVue.js:78,6]
error Command failed with exit code 2.
info Visit https://yarnpkg.com/en/docs/cli/run for documentation about this command.

@OmgImAlexis
Copy link

OmgImAlexis commented Dec 23, 2016

@andrzejkupczyk already have an issue(#48) about that. 👍

@kushalpandya
Copy link

I'm still facing this issue (with v0.3.12) while trying to register BootstrapVue globally.

This is error I get while trying to use Alerts.

[Vue warn]: Error when rendering component <bAlert>:
Uncaught ReferenceError: _h is not defined

I tried it with a webpack configuration generated using Vuepack (which is based on Webpack 2.2 RC) as well as with vue-webpack-boilerplate. Is there something that I'm missing here?

@pi0
Copy link
Member

pi0 commented Dec 27, 2016

@kushalpandya New version is not released yet however your problem seems not related to that... would you please provide your entry point script ?

@kushalpandya
Copy link

kushalpandya commented Dec 27, 2016

@pi0 Sure, here's my main.js

import Vue from 'vue';
import VueRouter from 'vue-router';
import BootstrapVue from 'bootstrap-vue';

import App from './App';
import Routes from './routes';

Vue.use(VueRouter);
Vue.use(BootstrapVue);

const router = new VueRouter(Routes);

const app = new Vue({
  router,
  ...App
});

app.$mount('#app');

And here's usage within a template (it is also a router outlet)

<template lang="html">
  <div class="container-fluid page-body">
    <b-alert :show="true" state="success" dismissible>
      This is an alert
    </b-alert>
    <router-view></router-view>
  </div>
</template>

@pi0
Copy link
Member

pi0 commented Dec 27, 2016

@kushalpandya Sorry for delay. I've created a dummy workingexample using Vuepack and latest version of this repo. Please see vuepack-bootstrap-example.
Good luck ;) and feel free to open another issue if problem exists with latest version.

@kushalpandya
Copy link

@pi0 Thanks a lot for a quick example to test 😃 that did fix my problem, I probably had incorrect property mappings in new Vue() call, as well as I had tether and promise-polyfill missing in dependencies (I guess tether is still required for Bootstrap to work) while promises support is only needed if I use vuex (which I'm not, currently).

Thanks a ton for saving me hours of frustration! 🎉

@Jonas-buriti
Copy link

I'm facing the same issue (ReferenceError: _h is not defined). I'm looking forward to the "Vue 2.1 -ready" vesion. Tks Guys!

@mathlef0u
Copy link
Contributor

Hey @Jonas-buriti, what is your webpack version ?

@sn0rcha
Copy link

sn0rcha commented Jan 6, 2017

Does anyone know if this issue is fixed?

@mathlef0u
Copy link
Contributor

Yes it is !

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests