question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Versions

  • 1.7.6

Describe the bug

Currently, all examples are targeting Vue 2. As the project claims to be compatible with Vue 3, it would be great to see an example implementation.

I tried implementing my own example but failed, but this might just be because I do not have much experience with plugins or Vue in general. I am currently working on a Vue 3 project and would like to use the toast notfications in my project. However, simply bumping the dependency in the code sandbox to ^3.0.0-beta.1 does not work.

Instead, I tried to add the plugin directly into the project. The relevant parts of my project look as follows.

// App.vue

<script lang="ts">
import { provideToast } from "vue-toastification/composition";
import "vue-toastification/dist/index.css";

export default {
    name: 'App',
    components: {
        
    },
    setup() {
        // Pass the Plugin Options here
        provideToast({ timeout: 3000 });
        // This is similar to `Vue.use(Toast)`, but will not register `$toast` to the Vue instance.
    }
}
</script>
// main.ts

import { createApp } from 'vue';
import App from './App.vue';
import Router from './router';
import {store} from './store/store';
import './assets/styles/index.css';

const app = createApp(App);
app.use(Router);
app.use(store);
app.mount('#app');
stacktrace:

index.js?6c42:272 Uncaught TypeError: Cannot read property 'extend' of undefined
    at eval (index.js?6c42:272)
    at Module../node_modules/vue-toastification/dist/esm/index.js (chunk-vendors.js:2448)
    at __webpack_require__ (app.js:849)
    at fn (app.js:151)
    at eval (index.js?04b0:17)
    at Object../node_modules/vue-toastification/composition/index.js (chunk-vendors.js:2436)
    at __webpack_require__ (app.js:849)
    at fn (app.js:151)
    at eval (App.vue?1f00:2)
    at Module../node_modules/cache-loader/dist/cjs.js?!./node_modules/babel-loader/lib/index.js!./node_modules/ts-loader/index.js?!./node_modules/cache-loader/dist/cjs.js?!./node_modules/vue-cli-plugin-vue-next/node_modules/vue-loader/dist/index.js?!./src/App.vue?vue&type=script&lang=ts (app.js:938)

Expected behavior

The provide function should work and I should be able to then use the features.

Your Environment

“vue”: “^3.0.0-beta.1”, “vue-toastification”: “^1.7.6” (I think nothing else is relevant here, but let me know if that assumption is wrong.)

Additional context

If you got it working with Vue3, I would be very happy with a working example.

Issue Analytics

  • State:closed
  • Created 3 years ago
  • Reactions:2
  • Comments:5 (2 by maintainers)

github_iconTop GitHub Comments

2reactions
Maronatocommented, Sep 20, 2020

Hello, @patrickfnielsen! Good news! v2.0.0-beta.3 has been released and it now supports Vue 3. Support for Vue 2 has been dropped in v2+, but will continue on v1.x.

You can try it out by installing with the next tag, yarn add vue-toastification@next.

Please take a look at the docs, since some things have changed.

0reactions
patrickfnielsencommented, Aug 24, 2020

Vue3 is now in RC, so there should be no more breaking changes. Any update on when we can expect a version that’s compatible with Vue3?

Read more comments on GitHub >

github_iconTop Results From Across the Web

Frequently Asked Questions - Vue.js
What browsers does Vue support? #. The latest version of Vue (3.x) only supports browsers with native ES2015 support. This excludes IE11. Vue...
Read more >
Vue.js 3 support - BootstrapVue
Quickly integrate Bootstrap v4 components with Vue.js. ... @vue/compat support is designed for early migration to Vue.js 3 and will be eventually replaced ......
Read more >
Vue 3 – A roundup of infos about the new version of Vue.js
This version will be available as a LTS (long-term support) version for 18 months, which means that it will still get security updates...
Read more >
Vue - endoflife.date
Vue is a JavaScript framework for building user interfaces. It builds on top of standard ... Release, Released, Active Support, Security Support, Latest ......
Read more >
Which UI Frameworks Support Vue 3? - In Plain English
BootstrapVue (13.2k stars on GitHub) enables the usage of Bootstrap (151k stars on GitHub) components in Vue 2 projects. BootstrapVue does not ...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found