Skip to content
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

vue-snotify not working when project is loading through RequireJS #76

Open
flytomek opened this issue Mar 4, 2019 · 0 comments
Open

Comments

@flytomek
Copy link

flytomek commented Mar 4, 2019

I generated new Vue.JS project using vue-cli and installed vue-snotify. I built project using

vue build --target lib --name myLib src/main.js

and loaded scripts using RequireJS

    <script>
        require(["Vue"], function (Vue) {
                window.Vue = Vue;
            console.log(Vue, 'Vue loaded');
            require(["myLib"], function (widget) {
                console.log('myLib loaded');
            });
        });
    </script>

However I got this error:
Uncaught TypeError: Cannot read property 'extend' of undefined
which leads me to this piece of code:

var script = external_commonjs_vue_commonjs2_vue_root_Vue_default.a.extend({
    props: ['toast'],
    data: function () {
        return {
            isPromptFocused: false,
        };
    },
    methods: {
        valueChanged: function (e) {
            this.toast.value = e.target.value;
            this.toast.eventEmitter.$emit('input');
        }
    }
});

Loading scripts directly thorugh script tag works fine, problem is where I'm using RequireJS.

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

No branches or pull requests

1 participant