Edge function not supporting packages in package.json

I followed these instructions to get npm modules available in edge functions: Support for npm modules in Edge Functions

Specfically: start by adding it to your project, for example npm install lodash

But I’m getting: Error: Cannot find module ‘html-minifier’"

Even though the package.json is located at my projects base directory.

Do you have a way for us to reproduce this issue?

It runs on this url: https://deploy-preview-4--bus-fyi.netlify.app/ac-transit/stops/55990/soon/

You don’t seem to be using Edge Functions and the error seems to be coming from your Function. Your repo is private, so we can’t check much beyond this. If you can share your repo, that can reveal more insights.

Hey there hrishikesh, what github user can I share it with?

hrishikesh-k: hrishikesh-k (Hrishikesh Kokate) · GitHub

I’m unable to test this. At first, I got an error about a misising environment variable, but after adding that, locally, I’m getting an error:

error sending request for url (https://api.actransit.org/transit/actrealtime/prediction?stpid=55990&token=<redacted>): channel closed

That’s the error on the URL http://localhost:8888/ac-transit/stops/55990/soon/