denodb icon indicating copy to clipboard operation
denodb copied to clipboard

Unable to run my project due to unavailable dep

Open LoganTann opened this issue 2 years ago • 21 comments

I tried to add denodb to my project, but a dependency seems unavailable.

error: Import 'https://dev.jspm.io/npm:@jspm/core@1/nodelibs/timers.js' failed: 500 Internal Server Error

error: Import 'https://dev.jspm.io/npm:@jspm/core@1/nodelibs/timers.js' failed: 500 Internal Server Error

steps to reproduce

  • make sure docker in installed in your system.
  • clone the code in https://github.com/LoganTann/redbeansoup-v2/tree/issue-timerjs
  • run the code by moving in the repo's root folder, and docker-compose up

LoganTann avatar Jun 20 '22 23:06 LoganTann

opened a quick pull request a 2w ago to address this issues. #347

Aiko-Suzuki avatar Jun 30 '22 19:06 Aiko-Suzuki

Yes, I use your repo as import URL since I opened this issue I hope it will get merged soon !

LoganTann avatar Jul 01 '22 05:07 LoganTann

@LoganTann @Aiko-Suzuki which version of deno you are using? because with the fix that @Aiko-Suzuki did, I got these errors now:

error: TS2578 [ERROR]: Unused '@ts-expect-error' directive.
      // @ts-expect-error
      ~~~~~~~~~~~~~~~~~~~
    at https://deno.land/[email protected]/node/events.ts:100:7

TS2578 [ERROR]: Unused '@ts-expect-error' directive.
        // @ts-expect-error
        ~~~~~~~~~~~~~~~~~~~
    at https://deno.land/[email protected]/node/events.ts:105:9

TS2578 [ERROR]: Unused '@ts-expect-error' directive.
      // @ts-expect-error
      ~~~~~~~~~~~~~~~~~~~
    at https://deno.land/[email protected]/node/events.ts:116:7

TS2578 [ERROR]: Unused '@ts-expect-error' directive.
      // @ts-expect-error
      ~~~~~~~~~~~~~~~~~~~
    at https://deno.land/[email protected]/node/events.ts:200:7

TS2578 [ERROR]: Unused '@ts-expect-error' directive.
    // @ts-expect-error
    ~~~~~~~~~~~~~~~~~~~
    at https://deno.land/[email protected]/node/events.ts:225:5

TS2578 [ERROR]: Unused '@ts-expect-error' directive.
        // @ts-expect-error
        ~~~~~~~~~~~~~~~~~~~
    at https://deno.land/[email protected]/node/events.ts:391:9

TS2578 [ERROR]: Unused '@ts-expect-error' directive.
      // @ts-expect-error
      ~~~~~~~~~~~~~~~~~~~
    at https://deno.land/[email protected]/node/events.ts:424:7

TS2578 [ERROR]: Unused '@ts-expect-error' directive.
          // @ts-expect-error
          ~~~~~~~~~~~~~~~~~~~
    at https://deno.land/[email protected]/node/events.ts:446:11

TS2578 [ERROR]: Unused '@ts-expect-error' directive.
          // @ts-expect-error
          ~~~~~~~~~~~~~~~~~~~
    at https://deno.land/[email protected]/node/events.ts:451:11

TS2578 [ERROR]: Unused '@ts-expect-error' directive.
    // @ts-expect-error
    ~~~~~~~~~~~~~~~~~~~
    at https://deno.land/[email protected]/node/events.ts:646:5

TS2578 [ERROR]: Unused '@ts-expect-error' directive.
    // @ts-expect-error
    ~~~~~~~~~~~~~~~~~~~
    at https://deno.land/[email protected]/node/events.ts:667:5

TS2345 [ERROR]: Argument of type 'FieldValue' is not assignable to parameter of type 'string | number | Uint8Array | ObjectId | undefined'.
  Type 'null' is not assignable to type 'string | number | Uint8Array | ObjectId | undefined'.
          whereClause.value = new Bson.ObjectId(whereClause.value);
                                                ~~~~~~~~~~~~~~~~~
    at https://raw.githubusercontent.com/Aiko-Suzuki/denodb/master/lib/connectors/mongodb-connector.ts:78:49

TS2345 [ERROR]: Argument of type 'FieldValue' is not assignable to parameter of type 'string | number | Uint8Array | ObjectId | undefined'.
              (value) => new Bson.ObjectId(value)
                                           ~~~~~
    at https://raw.githubusercontent.com/Aiko-Suzuki/denodb/master/lib/connectors/mongodb-connector.ts:152:44

Found 13 errors.

I'm using deno v1.21.3

slim-hmidi avatar Jul 13 '22 14:07 slim-hmidi

@slim-hmidi i use 1.23 may upgrade my project to latest soon

Aiko-Suzuki avatar Jul 13 '22 14:07 Aiko-Suzuki

it's clear, because even in the PR check there are the same log errors, you can check them https://github.com/eveningkid/denodb/pull/347/checks

slim-hmidi avatar Jul 13 '22 14:07 slim-hmidi

Yeah those error are not new even without the PR #337 😕

Aiko-Suzuki avatar Jul 13 '22 14:07 Aiko-Suzuki

you can run with with "--no-check" if below 1.23. if you are using 1.23 you don't need to https://deno.com/blog/v1.23 since the check is only local by default

Aiko-Suzuki avatar Jul 13 '22 14:07 Aiko-Suzuki

I'm using deno v1.21.3

1.22.1 in my side

LoganTann avatar Jul 15 '22 08:07 LoganTann

Is there any progress on this issue? I see a pull request has been open but has not yet been merged.

joeldesante avatar Jul 18 '22 00:07 joeldesante

The maintainer seems to not be actif :/

Aiko-Suzuki avatar Jul 18 '22 00:07 Aiko-Suzuki

I've implemented the pull request on my own fork of the project if anyone needs it and doesn't want to do it themselves.

Here is an example of the import to use for the fixed version while we wait for the pull request.

import { Relationships, DataTypes, Database, Model, SQLite3Connector } from 'https://raw.githubusercontent.com/joeldesante/denodb/master/mod.ts';

joeldesante avatar Jul 18 '22 02:07 joeldesante

I still don't quite understand how to deal with this problem image

tw-towey avatar Jul 18 '22 11:07 tw-towey

I still don't quite understand how to deal with this problem image

Instead of import {something} from "https://deno.land/x/denodb/mod.ts";
Do this instead : import {something} from "https://raw.githubusercontent.com/joeldesante/denodb/master/mod.ts";

LoganTann avatar Jul 18 '22 11:07 LoganTann

I've implemented the pull request on my own fork of the project if anyone needs it and doesn't want to do it themselves.

Here is an example of the import to use for the fixed version while we wait for the pull request.

import { Relationships, DataTypes, Database, Model, SQLite3Connector } from 'https://raw.githubusercontent.com/joeldesante/denodb/master/mod.ts';

There is a new error with your workaround (at least today):

Download https://raw.githubusercontent.com/Zhomart/dex/update-deps/lib/deps/[email protected]/dist/PromiseInspection.dew.js
error: Import 'https://dev.jspm.io/npm:@jspm/core@1/nodelibs/timers.js' failed: 500 Internal Server Error
    at https://dev.jspm.io/npm:[email protected]/dist/Pool.dew.js:5:21

paulocr avatar Jul 22 '22 01:07 paulocr

I've implemented the pull request on my own fork of the project if anyone needs it and doesn't want to do it themselves. Here is an example of the import to use for the fixed version while we wait for the pull request.

import { Relationships, DataTypes, Database, Model, SQLite3Connector } from 'https://raw.githubusercontent.com/joeldesante/denodb/master/mod.ts';

There is a new error with your workaround (at least today):

Download https://raw.githubusercontent.com/Zhomart/dex/update-deps/lib/deps/[email protected]/dist/PromiseInspection.dew.js
error: Import 'https://dev.jspm.io/npm:@jspm/core@1/nodelibs/timers.js' failed: 500 Internal Server Error
    at https://dev.jspm.io/npm:[email protected]/dist/Pool.dew.js:5:21

I havn't been able to reproduce this error. Are you sure you have everything correct on your end?

joeldesante avatar Jul 22 '22 02:07 joeldesante

I've implemented the pull request on my own fork of the project if anyone needs it and doesn't want to do it themselves. Here is an example of the import to use for the fixed version while we wait for the pull request.

import { Relationships, DataTypes, Database, Model, SQLite3Connector } from 'https://raw.githubusercontent.com/joeldesante/denodb/master/mod.ts';

There is a new error with your workaround (at least today):

Download https://raw.githubusercontent.com/Zhomart/dex/update-deps/lib/deps/[email protected]/dist/PromiseInspection.dew.js
error: Import 'https://dev.jspm.io/npm:@jspm/core@1/nodelibs/timers.js' failed: 500 Internal Server Error
    at https://dev.jspm.io/npm:[email protected]/dist/Pool.dew.js:5:21

I havn't been able to reproduce this error. Are you sure you have everything correct on your end?

Yes, sorry nevermind. I think I was missing something on my end. Thanks for the workaround!

paulocr avatar Jul 22 '22 02:07 paulocr

Still seeing this:

error: Import 'https://dev.jspm.io/[email protected]' failed: 500 Internal Server Error
    at https://raw.githubusercontent.com/Zhomart/dex/930253915093e1e08d48ec0409b4aee800d8bd0c/lib-dyn/deps.ts:4:26

reggi avatar Aug 20 '22 16:08 reggi

workaround:

{
  "imports": {
    "https://dev.jspm.io/npm:@jspm/core@1/nodelibs/timers.js": "https://ga.jspm.io/npm:@jspm/[email protected]/nodelibs/deno/timers.ts",
    "https://dev.jspm.io/[email protected]": "https://ga.jspm.io/npm:[email protected]/inherits.js",
  },
  "scopes": {
    "https://ga.jspm.io/": {
      "util": "https://ga.jspm.io/npm:@jspm/[email protected]/nodelibs/deno/util.ts"
    }
  }
}

reggi avatar Aug 20 '22 17:08 reggi

it works!

shizhouhu avatar Aug 22 '22 06:08 shizhouhu

workaround:

{
  "imports": {
    "https://dev.jspm.io/npm:@jspm/core@1/nodelibs/timers.js": "https://ga.jspm.io/npm:@jspm/[email protected]/nodelibs/deno/timers.ts",
    "https://dev.jspm.io/[email protected]": "https://ga.jspm.io/npm:[email protected]/inherits.js",
  },
  "scopes": {
    "https://ga.jspm.io/": {
      "util": "https://ga.jspm.io/npm:@jspm/[email protected]/nodelibs/deno/util.ts"
    }
  }
}

Thanks for the fix but where do I put this ?? Writing it in a deno.json and running my code with deno --config ./deno.json run ... doesn't fix it.

SirWrexes avatar Sep 05 '22 19:09 SirWrexes

@SirWrexes the code block I put my previous comment goes into a import_map.json file.

In the deno.json you then need to add "importMap": "./import_map.json".

reggi avatar Sep 05 '22 22:09 reggi