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

350
Visualizações
Uncaught SyntaxError: The requested module does not provide an export named

i've got this error in my console

Uncaught SyntaxError: The requested module './components/tileHeader/controller.js' does not provide an export named 'tileHeader'

this is my code components/tileHeader/controller.js:

Vue.component('tileHeader',{
    template: '#tileHeader',
    data(){
        return{
            count:0
        }
    },
})

components/tileHeader/view.html:

<script type="text/x-template" id="tileHeader">
        <div class="container">
            <div class="row">
                <div class="col">
                    <!--<div v-show="item.label != null || item.label == undefined" 
                    class="label">{{item.label}}</div>
                    <img v-show="item.image != null" src="item.image"/>-->
                    <p>This is a Test</p>
                </div>
            </div>
        </div>
</script>

main.js:

import Vue from './vue.js';
import { tileHeader } from './components/tileHeader/controller.js';

  new Vue({
    el: '#app',
    components: {
        'tileHeader': tileHeader
    },
  })

index.html:

<!DOCTYPE html>
<html>

<head>
    <title>Vue X-Templates</title>
</head>

<body>
    <div id="#app"></div>
    <script type="module" src="main.js"></script>
</body>

</html>

i'm working with x-templates. this is my project structure: structure

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

0

Could you try something like this ?

Create a single file that will contain your html / css and js.

tileHeader.vue :

<template>
<!-- Your view.html  -->
</template>

<script>
export default {
  name: 'tileHeader',
}
</script>

<style scoped>
</style>

Since the file has a export default, you'll be able to import it in another file

Add to main.js :

import tileHeader from "./components/tileHeader.vue";
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