vuetify-toast-snackbar icon indicating copy to clipboard operation
vuetify-toast-snackbar copied to clipboard

[Vue Warn] - Error in render

Open Morney opened this issue 4 years ago • 31 comments

vue.js:634 [Vue warn]: Error in render: "TypeError: Cannot read property 'bar' of undefined"

found in

getting the above error in console when trying to use this plugin, also I am getting this error when using the demo site: https://eolant.github.io/vuetify-toast-snackbar/

This seems to only of started happening today, any thoughts on why this is happening?

Morney avatar Jun 17 '20 09:06 Morney

I noticed this too after upgrading from "vuetify": "^2.1.12", "vuetify-loader": "^1.4.2", to "vuetify": "^2.3.0", "vuetify-loader": "^1.5.0",

The sample app was working on vuetify 2.1.12

cnayan avatar Jun 17 '20 12:06 cnayan

This issue is being discussed in Discord channel https://discord.com/channels/340160225338195969/351121729164410882

cnayan avatar Jun 17 '20 12:06 cnayan

The demo app is broken too with this error

Link to demo: https://eolant.github.io/vuetify-toast-snackbar/

cnayan avatar Jun 17 '20 12:06 cnayan

Thanks @cnayan As far as I am aware this is not linked with Vuetify developers, so the guys at vuetify wont really look into this.

the newest version of vuetify brings some changes into snackbars and so I believe this plugin will need its code updating to come inline with recent changes.

Morney avatar Jun 17 '20 12:06 Morney

One of the core team member of Vuetify said

Due to internal changes made in VSnackbar, this plugin will have to be updated before it can be used in 2.3

cnayan avatar Jun 17 '20 13:06 cnayan

@eolant has had no contribution on git since Oct last year, so may have to look at other options for this plugin :(

Morney avatar Jun 17 '20 14:06 Morney

Try this way ` import Vuetify from "vuetify/lib"; const VuetifyObj = new Vuetify({ theme: {}, lang: { locales: { zhHans }, current: "zhHans" } });

export default VuetifyObj;

Vue.use(VuetifyToast, {$vuetify: VuetifyObj.framework} `

duowb avatar Jun 18 '20 10:06 duowb

@duoWB It worked! Thank you!

Here is the compiling code:

` import Vue from 'vue'; import Vuetify, { VSnackbar } from 'vuetify/lib' import VuetifyToast from 'vuetify-toast-snackbar'

Vue.use(Vuetify, { components: { VSnackbar } })

const opts = {}; // your options

const vueObj = new Vuetify(opts);

export default vueObj;

Vue.use(VuetifyToast, { $vuetify: vueObj.framework }); `

cnayan avatar Jun 18 '20 12:06 cnayan

Ive got this working, seems good, thank you @cnayan and @duoWB

@ricardo17coelho

try moving your: Vue.use(vuetifyToast....

put this below the export default vueObj

Then get rid of Vue.use(vuetifyToast, { $vuetify: vueobj.framework });

And just add that into the full declaration like this:

Vue.use(VuetifyToast, { $vuetify: vuetify.framework, x: 'right', // default y: 'top', // default color: 'info', // default icon: '', iconColor: '', // default classes: [ 'body-2' ], timeout: 3000, // default dismissable: true, // default multiLine: false, // default vertical: false, // default queueable: true, // default showClose: false, // default closeText: '', // default closeColor: '', // default shorts: { custom: { color: 'purple' } }, property: '$toast' // default });

Morney avatar Jun 18 '20 14:06 Morney

Ive got this working, seems good, thank you @cnayan and @duoWB

@ricardo17coelho

try moving your: Vue.use(vuetifyToast....

put this below the export default vueObj

Then get rid of Vue.use(vuetifyToast, { $vuetify: vueobj.framework });

And just add that into the full declaration like this:

Vue.use(VuetifyToast, { $vuetify: vuetify.framework, x: 'right', // default y: 'top', // default color: 'info', // default icon: '', iconColor: '', // default classes: [ 'body-2' ], timeout: 3000, // default dismissable: true, // default multiLine: false, // default vertical: false, // default queueable: true, // default showClose: false, // default closeText: '', // default closeColor: '', // default shorts: { custom: { color: 'purple' } }, property: '$toast' // default });

it works. thanks @cnayan , @duoWB and @Morney

ricardo17coelho avatar Jun 18 '20 14:06 ricardo17coelho

Fixed. Commited Pull Request. Only Work with Vuetify 2.3 above https://github.com/jaredhan418/vuetify-toast-snackbar

jaredhan418 avatar Jun 18 '20 14:06 jaredhan418

Resolve problem in nuxt.js plugin:

import Vue from 'vue'
import VuetifyToast from 'vuetify-toast-snackbar'

export default (context, inject) => {
	Vue.use(VuetifyToast, {
		$vuetify: context.$vuetify
	})
}

TeleMediaCC avatar Jun 19 '20 07:06 TeleMediaCC

Solution with shorthand:

import Vue from 'vue'
import VuetifyToast from 'vuetify-toast-snackbar'

export default ({ $vuetify }) => {
	Vue.use(VuetifyToast, {
		$vuetify
	})
}

TeleMediaCC avatar Jun 19 '20 08:06 TeleMediaCC

There's another issue. The snackbar layout is broken.

phiter avatar Jul 03 '20 13:07 phiter

Hey guys, I'm uploaded a npm package https://www.npmjs.com/package/vuetify-toast-snackbar-ng compatible with Vuetify 2.3+

jaredhan418 avatar Jul 04 '20 03:07 jaredhan418

@phiter I can confirm this... image also in @jaredhan418 package

ricardo17coelho avatar Jul 04 '20 10:07 ricardo17coelho

@phiter @ricardo17coelho Somehow, this layout issue is not happening for me. What is different in your code?

cnayan avatar Jul 04 '20 19:07 cnayan

@phiter @ricardo17coelho. Try create global.css file, for example in src/assets and set this style

.vts .v-snack__content {
  display: flex;
  justify-content: center;
  align-items: center;
}

Then import this global file in main.js

import '../src/assets/global.css';

davidsmej88 avatar Jul 07 '20 10:07 davidsmej88

@davidsmej88 I ended up just copying the source code to my repo instead of downloading the package, since the package is not being updated anymore.

phiter avatar Jul 07 '20 11:07 phiter

Sorry, guys, been very busy with a new job, I'll find time to resolve all issues soon, promise!

eolant avatar Jul 07 '20 23:07 eolant

typeof 'soon' === 'undefined'; // true

pijlwagen avatar Jul 25 '20 12:07 pijlwagen

any updates on this? any timeline?

p0wl90 avatar Aug 17 '20 13:08 p0wl90

any updates on this? any timeline?

No, use https://www.npmjs.com/package/vuetify-toast-snackbar-ng

pijlwagen avatar Aug 17 '20 13:08 pijlwagen

Hi there, I'm updating a new version of vuetify-toast-snackbar-ng welcome to use.

jaredhan418 avatar Aug 18 '20 03:08 jaredhan418

Ah nice! When I looked yesterday the layout bug still existed in your repo but you just fixed it. Thanks!

p0wl90 avatar Aug 18 '20 06:08 p0wl90

@jaredhan418 I just saw that the layout is still a bit off (the close icon is too far on the right): image

I'm posting this issue here because your repository does not have an issue tracker. Maybe you can add one?

p0wl90 avatar Aug 18 '20 06:08 p0wl90

@jaredhan418 I just saw that the layout is still a bit off (the close icon is too far on the right): image

I'm posting this issue here because your repository does not have an issue tracker. Maybe you can add one?

https://github.com/jaredhan418/vuetify-toast-snackbar-ng/issues here you are.

jaredhan418 avatar Aug 18 '20 06:08 jaredhan418

Hi there, I'm updating a new version of vuetify-toast-snackbar-ng welcome to use.

@jaredhan418 I installed your package instead of vuetify-toast-snackbar but getting some strange errors

Module parse failed: Unexpected token (9:27)
You may need an appropriate loader to handle this file type.
| import mergeData from '../../util/mergeData';
| import { getObjectValueByPath, getPropertyFromItem, keyCodes } from '../../util/helpers';
| const defaultMenuProps = { ...VSelectMenuProps,
|   offsetY: true,
|   offsetOverflow: true,

 @ ./node_modules/vuetify/lib/components/VAutocomplete/index.js 1:0-44
 @ ./node_modules/vuetify/lib/components/index.js
 @ ./node_modules/vuetify/lib/index.js
 @ ./node_modules/vuetify-toast-snackbar-ng/dist/index.umd.js
 @ ./src/main.js
 @ multi (webpack)-dev-server/client?http://localhost:8082 webpack/hot/dev-server ./src/main.js

lorro avatar Oct 21 '20 14:10 lorro

There is a link to the issue tracker of his package literally above your post.

p0wl90 avatar Oct 21 '20 14:10 p0wl90

Hi there, I'm updating a new version of vuetify-toast-snackbar-ng welcome to use.

@jaredhan418 I installed your package instead of vuetify-toast-snackbar but getting some strange errors

Module parse failed: Unexpected token (9:27)
You may need an appropriate loader to handle this file type.
| import mergeData from '../../util/mergeData';
| import { getObjectValueByPath, getPropertyFromItem, keyCodes } from '../../util/helpers';
| const defaultMenuProps = { ...VSelectMenuProps,
|   offsetY: true,
|   offsetOverflow: true,

 @ ./node_modules/vuetify/lib/components/VAutocomplete/index.js 1:0-44
 @ ./node_modules/vuetify/lib/components/index.js
 @ ./node_modules/vuetify/lib/index.js
 @ ./node_modules/vuetify-toast-snackbar-ng/dist/index.umd.js
 @ ./src/main.js
 @ multi (webpack)-dev-server/client?http://localhost:8082 webpack/hot/dev-server ./src/main.js

Check your package.json or webpack setting. Not my package error.

jaredhan418 avatar Oct 22 '20 07:10 jaredhan418

import Vue from 'vue'
import Vuetify, { VSnackbar, VBtn, VIcon } from 'vuetify/lib'
import VuetifyToast from 'vuetify-toast-snackbar'

Vue.use(Vuetify, {
  components: {
    VSnackbar,
    VBtn,
    VIcon
  }
})

const veutifyObj = new Vuetify({
    theme: { dark: true },
});

Vue.use(VuetifyToast, { $vuetify: veutifyObj.framework })

export default veutifyObj;

VictorioBerra avatar Nov 16 '20 20:11 VictorioBerra