Empresas
Empleos
  • Sobre nosotros
  • Soluciones
    • Publicación de vacantes
      Publica tu vacante y recibe candidatos calificados en 48h.
    • Evaluación de candidatos
      500+ pruebas técnicas y psicológicas, más anti-fraude.
    • Headhunting
      Búsqueda ejecutiva a la medida de principio a fin.
    • Nómina + EOR
      Dispersión de nómina y EOR en más de 15 países de LATAM.
  • Precios
  • Empleos

0

563
Vistas
Uncaught Error: Module build failed (from ./node_modules/babel-loader/lib/index.js): SyntaxError: Unexpected token (24:11)

I am using vue 3 to develop a google chrome extension. I want return a simple div in Vue 3 render function, this is the code looks like:

import client from './client';
import getOptions from '../public/default-options';
import {read} from '../public/clipboard';
import { defineComponent } from 'vue';

export default defineComponent( { 
  client ,
  async compiled() {
    this.inline = true;
    this.showForm = true;
    const {defaultApi , autoClipboard} = await getOptions( [ 'defaultApi' , 'autoClipboard' ] );

    this.query.api = defaultApi;
    if ( autoClipboard ) {
      this.query.text = read();
      this.safeTranslate();
    }
  } ,
  ready() {
    setTimeout( ()=> this.$els.textarea.focus() , 200 );
  },
  render(h) {
    return (
      <div level={1}>
        <span>Hello</span> world!
      </div>
    )
  }
});

when I compile this code, shows error like this:

ERROR in ./src/popup/st.js
Module build failed (from ./node_modules/babel-loader/lib/index.js):
SyntaxError: Unexpected token (25:6)

  23 |   render(h) {
  24 |     return (
> 25 |       <div level={1}>
     |       ^
  26 |         <span>Hello</span> world!
  27 |       </div>
  28 |     )
BabelLoaderError: SyntaxError: Unexpected token (25:6)

  23 |   render(h) {
  24 |     return (
> 25 |       <div level={1}>
     |       ^
  26 |         <span>Hello</span> world!
  27 |       </div>
  28 |     )

    at transpile (/home/dolphin/Documents/GitHub/crx-selection-translate/node_modules/babel-loader/lib/index.js:65:13)
    at Object.module.exports (/home/dolphin/Documents/GitHub/crx-selection-translate/node_modules/babel-loader/lib/index.js:173:20)
 @ ./src/popup/app.js 34:10-25
 @ ./src/popup/index.js 7:0-16

webpack 5.67.0 compiled with 1 error in 11309 ms

I am follow the example from here. what should I do to tweak my code to avoid this problem?

about 4 years ago · Juan Pablo Isaza
Responde la pregunta
Encuentra empleos remotos

¡Descubre la nueva forma de encontrar empleo!

Top de empleos
Top categorías de empleo
Empresas
Publicar vacante Precios Comercial
Legal
Términos y condiciones Política de privacidad
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomiéndame algunas ofertas
Necesito ayuda