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.

Auto import of Starport and StarportCarrier with Vitesse

See original GitHub issue

Hi,

I can get Starport to work with Vitesse if I do a manual import of Startport in each page and StarportCarrier in App.vue, however I’d like to use the unplugin-auto-import way, and I tried adding the following to AutoImport in vite.config.ts like so:

{
          'vue-starport': [
            'Starport',
            'StarportCarrier',
          ],
        },

But that didn’t seem to work, so I tried the global way in main.ts like so:

import StarportPlugin from 'vue-starport'
app.use(StarportPlugin({ keepAlive: true }))

But again that didn’t work.

And I noticed that in the Starport playground demo it just has the following in main.ts:

import Starport from 'vue-starport'
...
app.use(Starport({ keepAlive: true }))

And I tried this using this in ViteSSG like so:

import StarportPlugin from 'vue-starport'
...
(ctx) => {
    ctx.app.use(StarportPlugin({ keepAlive: true }))
...

But that also didn’t seem to work.

Am I missing a step with the auto import configuration somewhere? I wold rather auto import than manually do so in each page/App.

Issue Analytics

  • State:closed
  • Created a year ago
  • Comments:8 (8 by maintainers)

github_iconTop GitHub Comments

1reaction
antfucommented, Apr 25, 2022

With the app.use plugin, they we will be available globally. THere is no need to auto import.

0reactions
Youdamancommented, Apr 28, 2022

Thanks @tangdaoyuan, your explanation makes sense.

That said, I’ve since encountered an issue where the markup on the site still says <starportcarrier></starportcarrier> instead of being translated into a div, i.e. the component is not actually loading properly, however there are no errors.

So as a test I added import StarportCarrier from 'vue-starport' (and likewise for Starport in the pages) and now I get no component rendering at all. It completely disappears from the final markup that’s generated.

I think I will explore using Nuxt or something other than Vitesse for now until this issue is resolved as I really want to use Starport but not if there’s conflicts with other modules that are still works in progress that prevent it working.

Thank you for also investigating this problem, it makes me feel like I’m not going crazy! 😃

Read more comments on GitHub >

github_iconTop Results From Across the Web

Untitled
Kroeun knhong singing, Raija malvalehto, Hd wallpaper cars 2013, Indomita game, ... Siapa eddy sumarsono, Starport leasing strafford mo, V5122p-0408, ...
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