Investigating `esno` returns 500 internal server error

This issue has been tracked since 2022-05-31.

I wanted to compare the size of tsm and esno, but the latter package result in a 500 error. Visiting https://packagephobia.com/result?p=esno shows the following message.

This Serverless Function has crashed.

Your connection is working correctly.

Vercel is working correctly.

500: INTERNAL_SERVER_ERROR
Code: FUNCTION_INVOCATION_FAILED
ID: hnd1::fcgjg-1653998369391-e837880bb187

If you are a visitor, contact the website owner or try again later.
If you are the owner, learn how to fix the error and > check the logs.

Result of curl --insecure --verbose "https://packagephobia.com/v2/api.json?p=esno":
*   Trying 76.76.21.98...
* TCP_NODELAY set
* Connected to packagephobia.com (76.76.21.98) port 443 (#0)
* ALPN, offering h2
* ALPN, offering http/1.1
* Cipher selection: ALL:!EXPORT:!EXPORT40:!EXPORT56:!aNULL:!LOW:!RC4:@STRENGTH
* successfully set certificate verify locations:
*   CAfile: /etc/ssl/cert.pem
  CApath: none
* TLSv1.2 (OUT), TLS handshake, Client hello (1):
* TLSv1.2 (IN), TLS handshake, Server hello (2):
* TLSv1.2 (IN), TLS handshake, Certificate (11):
* TLSv1.2 (IN), TLS handshake, Server key exchange (12):
* TLSv1.2 (IN), TLS handshake, Server finished (14):
* TLSv1.2 (OUT), TLS handshake, Client key exchange (16):
* TLSv1.2 (OUT), TLS change cipher, Client hello (1):
* TLSv1.2 (OUT), TLS handshake, Finished (20):
* TLSv1.2 (IN), TLS change cipher, Client hello (1):
* TLSv1.2 (IN), TLS handshake, Finished (20):
* SSL connection using TLSv1.2 / ECDHE-RSA-AES256-GCM-SHA384
* ALPN, server accepted to use h2
* Server certificate:
*  subject: CN=packagephobia.com
*  start date: May 22 21:32:23 2022 GMT
*  expire date: Aug 20 21:32:22 2022 GMT
*  issuer: C=US; O=Let's Encrypt; CN=R3
*  SSL certificate verify result: certificate has expired (10), continuing anyway.
* Using HTTP2, server supports multi-use
* Connection state changed (HTTP/2 confirmed)
* Copying HTTP/2 data in stream buffer to connection buffer after upgrade: len=0
* Using Stream ID: 1 (easy handle 0x7fe6fe806400)
> GET /v2/api.json?p=esno HTTP/2
> Host: packagephobia.com
> User-Agent: curl/7.54.0
> Accept: */*
>
* Connection state changed (MAX_CONCURRENT_STREAMS updated)!
< HTTP/2 500
< date: Tue, 31 May 2022 11:55:18 GMT
< content-type: text/plain; charset=utf-8
< x-content-type-options: nosniff
< x-xss-protection: 1; mode=block
< x-frame-options: DENY
< x-vercel-error: FUNCTION_INVOCATION_FAILED
< content-length: 56
< server: Vercel
< x-vercel-id: hnd1::b6ztt-1653998118881-cc2ef595aa82
< strict-transport-security: max-age=63072000
< cache-control: public, max-age=0, must-revalidate
< x-vercel-cache: MISS
<
A server error has occurred

FUNCTION_INVOCATION_FAILED
* Connection #0 to host packagephobia.com left intact

Some old issues say these 500 errors come from the node-gyp and packagephobia does not have a plan to support it. Neither tsm nor esno are pure-JavaScript packages, but they both depend on ESbuild. So I don't really see any big differences between them.

styfle wrote this answer on 2022-05-31

ERROR Uncaught Exception {"errorType":"TypeError","errorMessage":"Cannot read properties of undefined (reading 'filename')","stack":["TypeError: Cannot read properties of undefined (reading 'filename')"," at /var/task/node_modules/npm/node_modules/npm-lifecycle/index.js:96:41"," at /var/task/node_modules/npm/node_modules/npm-lifecycle/index.js:218:12"," at callback (/var/task/node_modules/npm/node_modules/graceful-fs/polyfills.js:295:20)"," at FSReqCallback.oncomplete (node:fs:199:5)"]}

Seems like it might be an npm bug when running on Node.js 16.

I have on my todo list to update to the latest npm or switch to pnpm/yarn if necessary in #891

styfle wrote this answer on 2022-06-04

Upgraded but its still timing out. This package is just too big. You can confirm with this:

mkdir example
cd example
npm init -y
npm install esno
du -sh node_modules
styfle wrote this answer on 2022-06-19

This will be fixed in #976

More Details About Repo
Owner Name styfle
Repo Name packagephobia
Full Name styfle/packagephobia
Language TypeScript
Created Date 2018-03-20
Updated Date 2023-03-16
Star Count 1915
Watcher Count 18
Fork Count 49
Issue Count 11

YOU MAY BE INTERESTED

Issue Title Created Date Updated Date