Empresas
Empregos
  • Sobre nós
  • Soluções
    • Publicação de vagas
      Publique sua vaga e receba candidatos qualificados em 48h.
    • Avaliações de candidatos
      Mais de 500 testes técnicos e psicológicos, mais anti-fraude.
    • Headhunting
      Busca executiva personalizada do início ao fim.
    • Folha de Pagamento + EOR
      Dispersão de folha e EOR em mais de 15 países da LATAM.
  • Preços
  • Empregos

0

274
Visualizações
"rollup-plugin-svelte" The following packages did not export their `package.json`

I am new in svelte.js. help me please to fix it

Here, when I import the swiper carousel at my .svelte file. it shows me this error which is

[rollup-plugin-svelte] The following packages did not export their package.json file so we could not check the "svelte" field. If you had difficulties importing svelte components from a package, then please contact the author and ask them to export the package.json file.

Screenshot of Terminal Error. Please check this

This is my code file. here is another component of a carousel slider. but I am seeing this picture when I import the swiper carousel.

<script>
    import { Swiper, SwiperSlide } from "swiper/svelte";
    import PorfolioCard from "./../components/porfolio-card.svelte";
    import SectionTitle from "./../components/sectionTitle.svelte";
    import "swiper/css";
</script>

<section id="portfolio">
    <SectionTitle title="My Portfolio" subtitle="Visit My Portfolio And Keep your feedback" />

    <div class="mt-4 px-1 px-md-3 px-lg-5">
        <Swiper>
            <SwiperSlide>
                <PorfolioCard />
            </SwiperSlide>

            <SwiperSlide>
                <PorfolioCard />
            </SwiperSlide>

            <SwiperSlide>
                <PorfolioCard />
            </SwiperSlide>

            <SwiperSlide>
                <PorfolioCard />
            </SwiperSlide>

            <SwiperSlide>
                <PorfolioCard />
            </SwiperSlide>
            
        </Swiper>
    </div>
</section>

about 4 years ago · Juan Pablo Isaza
2 Respostas
Responde à pergunta

0

TL;DR

This error can be safely ignored if it's coming from modules that don't export svelte components (eg. stream, util, is-odd; modules that export Javascript files). You can even hide it via overriding onwarn in rollup.config.js:

const onwarn = (message, warn) => {
    const ignored = {
        PLUGIN_WARNING: ['`package.json`'],
    };
    const ignoredKeys = Object.keys(ignored);
    const ignoredValues = Object.values(ignored);

    for (let i = 0, l = ignoredKeys.length; i < l; ++i) {
        const ignoredKey = ignoredKeys[i];
        const ignoredValue = ignoredValues[i];

        for (const ignoredValuePart of ignoredValue) {
            if (message.code !== ignoredKey
                || !message.toString().includes(ignoredValuePart)) {
                continue;
            }

            return;
        }
    }

    warn(message);
};

export default {
    output: {
        format: 'esm',
        name: 'app',
        dir: 'public',
    },
    onwarn,
    plugins: [
        // your plugins, eg. `svelte()`
    ],
}

Mini-explanation

It's emitted because some modules specify the files they're exporting in package.json using the exports field, but they don't include package.json itself in the field. This messes with how rollup-plugin-svelte identifies modules which export svelte components — by reading package.json (it can't import what's specifically not exported!). Here's some more technical explanation on the plugin's Github page, regarding why the plugin does things like that & the benefits of it.

about 4 years ago · Juan Pablo Isaza Relatório

0

There is not currently a way to silence this warning. There is however an open issue on the GitHub repo regarding it.

https://github.com/sveltejs/rollup-plugin-svelte/issues/181

about 4 years ago · Juan Pablo Isaza Relatório
Responde à pergunta
Encontrar trabalhos remotos

Descubra a nova forma de encontrar um emprego!

melhores empregos
Principais categorias de trabalho
Empresas
Postar vaga Preços Comercial
Jurídico
Termos e Condições Política de privacidade
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomende algumas ofertas para mim
Preciso de ajuda