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

339
Visualizações
How do I fix "the requested module does not provide an export named 'default'"?

I'm developing app using JS and Vue.js and get error on line:

import Vue from 'vue'

I'm getting this:

Uncaught SyntaxError: The requested module '/node_modules/.vite/vue.js?v=6dba2ea6' does not provide an export named 'default'

I googled that might be caused by old Vue version, in my package.json vue version is 3.2.6, but

npm view vue version

returns 2.6.14, I tried to upgrade it with Vue CLI

vue upgrade

but npm command still return 2.6.14

I hope you could help me, what did I wrong or it is not even versions problem? Thanks!

about 4 years ago · Santiago Trujillo
1 Respostas
Responde à pergunta

0

The reason it didn't work is that Vue provides a named export, whereas you are trying to import it as though it had a default export.

To make a named import (which you must do with named exports), you need to wrap the name of the export you want to import in curly braces, so {} around Vue like this:

import { Vue } from 'vue';
      // ^^^ name of export

It will work

The thing you want to do is import vue but it doesnot have a default export function or either the default thing to export is not set in vue module. So you have to select function named vue by adding curly braces.

If it had a default export function, then your code would have worked and in that case you could write anything in place of vue like below:

import anyname from 'vue'

anyname is name whatever you want.

about 4 years ago · Santiago Trujillo 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