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

233
Vistas
Wasm-bindgen library and jest: Invalid or unexpected token @import"?

I'm trying to use jest in a react-typescript project that imports a rust/wasm library and while it works when I run the front-end, the jest test fails with:

/workspace/react-jest-rust/node_modules/rust-wasm-lib/index.js:73
export function message(s) {
^^^^^^
SyntaxError: Unexpected token 'export'

I've created an example, just run yarn test a after cloning: https://github.com/Findeton/react-jest-rust

I've tried configuring jest. If I add this to package.json:

  "jest": {
    "transformIgnorePatterns": [
      "node_modules/(?!rust-wasm-lib)/"
    ]
  }

Then I get this other error when running yarn test a:

/big/workspace/sequent/react-jest-rust/node_modules/rust-wasm-lib/index.js:125
    input = new URL('index_bg.wasm', import.meta.url);
                                            ^^^^

SyntaxError: Cannot use 'import.meta' outside a module

  2 | import logo from './logo.svg';
  3 | import './App.css';
> 4 | import init, {test} from 'rust-wasm-lib';
    | ^
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