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

118
Visualizações
SvelteKit cannot import Onboard.js

I am working on a SvelteKit project and have installed Onboard.js:

I am using the pnpm package manager, but it shouldn't make a difference:

pnpm install bnc-onboard
// __layout.svelte
import Onboard from "bnc-onboard";

When I start my development server, I get the following module resolution errors (not all have been included):

pnpm run dev

enter image description here

How can I fix this?

Edit: I tried following these rollup instructions. Since SvelteKit uses Vite, which is based on Rollup, I tried adding the following to svelte.config.js:

import resolve from '@rollup/plugin-node-resolve'
import commonjs from '@rollup/plugin-commonjs'
import json from '@rollup/plugin-json'
import nodePolyfills from 'rollup-plugin-node-polyfills'

// ...

export default {
  // ...
  kit: {
    // ...
    vite: {
       plugins: [
            json(),
            resolve({
                browser: true,
                preferBuiltins: true
            }),
            commonjs({
                namedExports: {
                    "u2f-api": ["sign", "isSupported"]
                },
            }),
            nodePolyfills(),
        ],
    },
  },
};

This did not help. I am getting the exact same error.

Edit 2: It appears the bnc-onboard package never installed correctly in the first place. I made another question about this here, and I'll update this question once I fix that.

Edit 3: I got the above solved. Now I'm getting this slightly different error:

enter image description here

Edit 4: I ran pnpm install @keystonehq/bc-ur-registry, I am now getting the following error instead:

enter image description here

about 4 years ago · Juan Pablo Isaza
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