Giter VIP home page Giter VIP logo

repl.it-db's People

Contributors

cursorweb avatar dependabot[bot] avatar masad-frost avatar mmellado avatar mrlapizgithub avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar

repl.it-db's Issues

Issue importing client on Typescript.

according to the Readme, I'm supposed to import the Client like this: const Client = require("@replit/database");

I'm working with Typescript, and my config rules don't allow em to use require statements, so I'm attempting to import the Client like this:

import Client from '@replit/database';

However doing this gives me a typescript error:

import Client
This expression is not constructable.
  Type 'typeof import("/project/node_modules/@replit/database/index")' has no construct signatures.

I then attempted to change the import to the following:

import { Client } from '@replit/database'

This has Typescript pass the build, letting me create an instance of the client. However, on execution on Replit I get the following error

/home/runner/saitama-bot/dist/controllers/server.js:14
const db = new database_1.Client();
           ^

TypeError: database_1.Client is not a constructor
    at Object.<anonymous> (/home/runner/my-bot/dist/controllers/server.js:14:12)

Now, I believe the first way of importing should have been correct based on the codebase, so I'm wondering if it's an issue with the type declarations for the class that get exported from the package?

repo name

Shouldn't it be replit-db? Or would it cause other problems if you changed it

delete item

you cant delete items if they start with a /
this means empty also doesn't work.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.