Skip to content

Vue is not defined after build #321

Closed
@mydnicq

Description

@mydnicq

I have this file as an entry for my Vue project.

/* src/index.js */

import Player from './components/player.vue';

export function install(Vue) {
  Vue.component('vue-player', Player);
}
...

When I run

vue build src/index.js

and then run the output in the browser I can't access the Vue object, even though the warning from vue.runtime.common.js indicates that the Vue object is present.

Nowhere in my project I don't import the Vue module, because I'm writing a plugin. So it's somehow unclear how vue.runtime.common.js is present?

Morevoer, because vue.runtime.common.js is present I expect that Vue object is defined on window, but it isn't.

Please see the picture below for more info:

vue-runtime

Can someone explain what is happening during the build process?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions