supabase / edge-runtime

A server based on Deno runtime, capable of running JavaScript, TypeScript, and WASM services.
MIT License
683 stars 62 forks source link

When I try importing directly from NPM via any of the following: #267

Closed andreespirela closed 6 months ago

andreespirela commented 9 months ago

@laktek When I try importing directly from NPM via any of the following:

import apn from "npm:apn"; import apn from "npm:apn@2.2.0"; import apn from "npm:apn@^2.2.0"; import apn from "npm:apn@latest";

I get the following:

thread '<unnamed>' panicked at /usr/src/edge-runtime/crates/sb_graph/graph_util.rs:339:36:
called `Result::unwrap()` on an `Err` value: Error in apn@2.2.0 parsing version requirement for dependency: http2@https://github.com/node-apn/node-http2/archive/apn-2.1.4.tar.gz

Invalid npm version requirement. Unexpected character.
  https://github.com/node-apn/node-http2/archive/apn-2.1.4.tar
  ~

Caused by:
    0: Invalid npm version requirement. Unexpected character.
         https://github.com/node-apn/node-http2/archive/apn-2.1.4.tar
         ~
    1: Unexpected character.
         https://github.com/node-apn/node-http2/archive/apn-2.1.4.tar
         ~
An error has occured
InvalidWorkerCreation: channel closed
    at async UserWorker.create (ext:sb_user_workers/user_workers.js:147:15)
    at async Server.<anonymous> (file:///home/deno/main/index.ts:129:20)
    at async #respond (https://deno.land/std@0.182.0/http/server.ts:220:18) {
  name: "InvalidWorkerCreation"
}

Originally posted by @Alexa-Green in https://github.com/supabase/supabase/discussions/21200#discussioncomment-8449239

nyannyacha commented 9 months ago

Note: This looks like an upstream bug.

laktek commented 6 months ago

Closing this since it's an upstream issue.