denoland / deploy_feedback

For reporting issues with Deno Deploy
https://deno.com/deploy
74 stars 5 forks source link

[Bug]: Build failing due to not found cached module (using npm package) #677

Closed kais-radwan closed 3 months ago

kais-radwan commented 3 months ago

Problem description

I'm using @upstash/vector from npm in my API, and it works fine locally and used to work on Deno Deploy before too, but today I'm trying to push an update and I'm getting this build error:

Error The deployment failed: Module not found "file:///.cache/deno/npm/registry.npmjs.org/openai/4.40.1/resources/beta/vector-stores/file-batches.d.ts".

I made sure that all the versions are up to date in my deno.json, but still this issue persist. This seems to me like a cached module file, I assume the issue is related to @upstash/vector because I don't use openai in my project, but I think upstash might use it for some stuff.

this is my deno.json import map:

  "imports": {
    "@upstash/vector": "npm:@upstash/vector@^1.1.2",
    "hono": "https://deno.land/x/hono/mod.ts",
    "jwt": "https://deno.land/x/djwt@v2.9.1/mod.ts",
    "libsql": "https://esm.sh/@libsql/client@0.6.0/web"
  }

Steps to reproduce

I'm not really sure, this used to work before, and this is the first time I run into such issue, but I can say this:

  1. Import npm:@upstash/vector into the app.
  2. Deploy it to Deno Deploy

Expected behavior

I believe the build should be done successfully, and my latest push (where I first saw this issue) doesn't introduce any new changes to the packages I'm using.

Environment

The error is occurring in Deno Deploy. I have the project connected to a private Github repository, and this issue is showing in a dev deployment (not production branch).

in my local environment it works just fine: deno 1.44.2 (release, x86_64-unknown-linux-gnu) v8 12.6.228.9 typescript 5.4.5

Possible solution

No response

Additional context

I tried to update the @upstash/vector version to the latest one and still the issue persist, this is a screenshot from the build logs:

Screenshot_2024-06-14_10-44-54

I also tried to add openai to my import map but it also didn't work out.

kais-radwan commented 3 months ago

UPDATE:

The issue was solved... so this points to another issues, and it's that the LSP auto complete pointed to a cached file in the local device somehow :(

Anyways I'm closing this one here