esm.sh icon indicating copy to clipboard operation
esm.sh copied to clipboard

Failed to import @angular/core or other modules. Error 500

Open devversion opened this issue 5 months ago • 11 comments

Failing module

  • GitHub: https://github.com/angular/angular
  • npm: https://npmjs.com/package/@angular/core
import {Component} from "https://esm.sh/@angular/[email protected]"

@Component({})
export class App {}

Error message

I seem to get lots of random 500 responses from esm.sh. This is reproducable in the ESM.sh playground as well.

Looking at the responses, there are a lot of Cloudflare Bypass / Miss responses as additional context. Not sure if that's related to the issue here.

Loading @angular/core loads rxjs transitively. This package has a lot of individual .mjs files; seemingly the majority of errors always happens on random files of that package. Is this a potential rate limiting?

devversion avatar Jul 03 '25 12:07 devversion

Facing the same problem. Server issue?

debanjandhar12 avatar Jul 03 '25 12:07 debanjandhar12

same for GraphiQL https://github.com/graphql/graphiql/issues/4048

dimaMachina avatar Jul 03 '25 13:07 dimaMachina

Also seeing this for @mui and @emution imports.

krassowski avatar Jul 03 '25 13:07 krassowski

seems the server met s3 storage IO limit

Image

ije avatar Jul 03 '25 14:07 ije

update: temporarily added a rate limiting to 200 requests pre 10s pre IP

ije avatar Jul 03 '25 15:07 ije

Awesome, thank you! will this rate limiting be removed in the future? (you mentioned it as being "temporary")

devversion avatar Jul 07 '25 10:07 devversion

Seeing a ton of these errors for react, react-dom and @mui.

philippjfr avatar Jul 07 '25 11:07 philippjfr

For anyone looking for self-hosting esm-sh on a subpath e.g. /esm/react (to share the same domain/port with the rest of frontend assets).

There is no way to configure esm.sh to listen on the subpath, so we used ast-grep with the transform to convert the code served by our local esm.sh instance.

We faced rate-limiting and it makes https://esm.sh impossible to use for us. It is crucial part for our test infrastructure, so we had to opt into self-hosting.

OEvgeny avatar Jul 09 '25 15:07 OEvgeny

the temporarily rate limiting have been removed after an hour. i'm working on a cache layer for S3 storage

ije avatar Jul 09 '25 15:07 ije

Thanks for the update.

The rate limits were observed July 7th 10am PT from my end, and from the above comment same day 4am PT. Maybe some other rate limits then?

Just checked and we're not rate-limited anymore.

OEvgeny avatar Jul 09 '25 15:07 OEvgeny

I don't seem to get these 500 errors anymore, thanks!

On the other hand, I see some QUIC errors and larger files from e.g. @angular/compiler end up being never cached as it seems. All responses have the cf-cache-status: miss header.

E.g.

esm.sh/@angular/[email protected]/X-ZXJ4anM/es2022/compiler.mjs:1  Failed to load resource: net::ERR_QUIC_PROTOCOL_ERROR

devversion avatar Jul 16 '25 12:07 devversion