Business
Jobs
  • About Us
  • Solutions
    • Job Postings
      Post your job and receive qualified candidates in 48h.
    • Candidate Assessments
      500+ technical and psychological tests, plus anti-fraud.
    • Headhunting
      Tailor-made executive search from start to finish.
    • Payroll + EOR
      Payroll dispersal and EOR across 15+ LATAM countries.
  • Pricing
  • Jobs

0

32
Views
Error [ERR_REQUIRE_ESM] require() del módulo ES no es compatible

Desarrollé una aplicación Shopify Remix antes de la migración de la plantilla a Vite. Hay una biblioteca @shopify/polaris-viz que estoy usando para gráficos. Sin embargo, arrojaba constantemente el error ERR_REQUIRE_ESM string-widthal intentar ejecutar el proyecto. Posteriormente se solucionó usando serverDependenciesToBundlecomo se sugiere aquí . Sin embargo, ahora tengo problemas para migrar esto a la implementación de Vite. Dado que ya no existe, remix.config.ts¿cuál debería ser la mejor manera de manejar el siguiente error?

require() of ES Module /app/node_modules/d3-scale/src/index.js from /app/node_modules/@shopify/polaris-viz-core/build/cjs/utilities/createGradient.js not supported.
Instead change the require of index.js in /app/node_modules/@shopify/polaris-viz-core/build/cjs/utilities/createGradient.js to a dynamic import() which is available in all CommonJS modules.

Mirar las discusiones 7872 y 7865 en el repositorio oficial de remezclas no parece estar funcionando. Como se sugiere en 7865, puse el paquete erróneo, en este caso d3-scaleen ssr -> noExternal pero esto no parece estar funcionando.

ssr: {
    noExternal: ["d3-scale"]
}

Pasos para reproducir el problema:

  1. Configurar un nuevo proyecto

  2. Agrega @shopify/polaris-viz al proyecto

  3. importar { PolarisVizProvider } desde "@shopify/polaris-viz";

Cualquier ayuda con esto es muy apreciada.

over 2 years ago · Carlos Garzón Colorado
Answer question
Find remote jobs

Discover the new way to find a job!

Top jobs
Top job categories
Business
Post vacancy Pricing Sales
Legal
Terms and conditions Privacy policy
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Show me some job opportunities
There's an error!