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

setupDevtoolsPlugin method not worked sometime #779

Open
pekonchan opened this issue Jan 21, 2025 · 3 comments
Open

setupDevtoolsPlugin method not worked sometime #779

pekonchan opened this issue Jan 21, 2025 · 3 comments
Labels
need reproduction Reproduction is needed

Comments

@pekonchan
Copy link

I write a plugin for devtools, when I use

import { setupDevtoolsPlugin } from '@vue/devtools-api'

setupDevtoolsPlugin({
    id:  'some_id',
    label: 'some_label',
    packageName: 'launch-editor',
    app,
  }, (api) => {
    console.log('🚀 ~ setupDevtools ~ api:', api)
    api.on.inspectComponent((payload, context) => {
      console.log('🚀 ~ setupDevtools ~ payload:', payload)
  })

Sometime the log does not print, but I refresh the page almost it can print.

Does devtools have caching ?

@pekonchan
Copy link
Author

I tried both 6.0.0-beta.11 and the latest version

@webfansplz webfansplz added the need reproduction Reproduction is needed label Jan 23, 2025
@webfansplz
Copy link
Member

Can you provide a mini repo? 🙏

@fdaugs
Copy link

fdaugs commented Feb 7, 2025

Same here. I ran into a problem with vue-i18n not completing the plugin install in dev mode because setupDevtoolsPlugin never calling the callback function.

If I call createI18n in my "main" application.js like this, it works without a problem:

const i18n = createI18n({
  availableLocales: Object.keys(translations),
  locale,
  fallbackLocale: defaultLocale,
  messages: translations,
  globalInjection: true,
});
app.use(i18n);

But when i18n instance is created in another module setupDevtoolsPlugin never calls the callback:

// i18n.js

export const i18n = createI18n({
  availableLocales: Object.keys(translations),
  locale,
  fallbackLocale: defaultLocale,
  messages: translations,
  globalInjection: true,
});
//main.js

import {i18n} from './i18n.js'

app.use(i18n);

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

No branches or pull requests

3 participants