eveningkid / denodb

MySQL, SQLite, MariaDB, PostgreSQL and MongoDB ORM for Deno

Home Page:https://eveningkid.com/denodb-docs

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Unable to run my project due to unavailable dep

LoganTann opened this issue · 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

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

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

@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/std@0.106.0/node/events.ts:100:7

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

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

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

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

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

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

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

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

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

TS2578 [ERROR]: Unused '@ts-expect-error' directive.
    // @ts-expect-error
    ~~~~~~~~~~~~~~~~~~~
    at https://deno.land/std@0.106.0/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 i use 1.23 may upgrade my project to latest soon

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

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

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

I'm using deno v1.21.3

1.22.1 in my side

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

The maintainer seems to not be actif :/

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';
commented

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

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";

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/tarn@3.0.0/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:tarn@3.0.2/dist/Pool.dew.js:5:21

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/tarn@3.0.0/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:tarn@3.0.2/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?

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/tarn@3.0.0/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:tarn@3.0.2/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!

commented

Still seeing this:

error: Import 'https://dev.jspm.io/inherits@2.0' failed: 500 Internal Server Error
    at https://raw.githubusercontent.com/Zhomart/dex/930253915093e1e08d48ec0409b4aee800d8bd0c/lib-dyn/deps.ts:4:26
commented

workaround:

{
  "imports": {
    "https://dev.jspm.io/npm:@jspm/core@1/nodelibs/timers.js": "https://ga.jspm.io/npm:@jspm/core@2.0.0-beta.24/nodelibs/deno/timers.ts",
    "https://dev.jspm.io/inherits@2.0": "https://ga.jspm.io/npm:inherits@2.0.4/inherits.js",
  },
  "scopes": {
    "https://ga.jspm.io/": {
      "util": "https://ga.jspm.io/npm:@jspm/core@2.0.0-beta.24/nodelibs/deno/util.ts"
    }
  }
}

it works!

workaround:

{
  "imports": {
    "https://dev.jspm.io/npm:@jspm/core@1/nodelibs/timers.js": "https://ga.jspm.io/npm:@jspm/core@2.0.0-beta.24/nodelibs/deno/timers.ts",
    "https://dev.jspm.io/inherits@2.0": "https://ga.jspm.io/npm:inherits@2.0.4/inherits.js",
  },
  "scopes": {
    "https://ga.jspm.io/": {
      "util": "https://ga.jspm.io/npm:@jspm/core@2.0.0-beta.24/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.

commented

@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".