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

157
Vistas
Why would a standard top-of-file import to suddenly cause failing on `npm run build` but not on `npm run dev`?

The module in question requires this, which works for dev

import { RRule, RRuleSet, rrulestr } from 'rrule'

This results in the following error from npm run build

import { RRule } from "rrule";
        ^^^^^
SyntaxError: Named export 'RRule' not found. The requested module 'rrule' is a CommonJS module,
which may not support all module.exports as named exports.
CommonJS modules can always be imported via the default export, for example using:

import pkg from 'rrule';
const { RRule } = pkg;

Then, when I do the import pkg like it suggested, that works for build but not on dev.

The normal import worked for months. About a month ago it stopped working and required this constant switcharoo between build and dev.

As far as I can tell, there were no updates to the module, os or environment. I'm on WSL2 ubuntu, but I have updates turned off. The package.json has not changed, I verified thru git file history.

So my questions are:

  1. What could have caused this?
  2. Neverminding the cause, how could I set this up so that I don't have to keep changing the import statements? Like for example if it sees localhost.
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