Giter Site home page Giter Site logo

Comments (3)

peter-murray avatar peter-murray commented on July 18, 2024

The packages are distributed in the dist not lib directory for this module, please update the import to use the dist files and let me know if that is still an issue.

from node-hue-api.

pindab0ter avatar pindab0ter commented on July 18, 2024

This is what I've tried:

import Api from "node-hue-api/dist/esm/api/Api";
import { createLocal } from "node-hue-api/dist/esm/api";

PHPStorm is not aware of any problems, but when I try to build, this is the error I'm getting:

build failed (src/hue/index.ts:3:28 import { createLocal } from "node-hue-api/dist/esm/api";): Could not resolve "node-hue-api/dist/esm/api"

Same goes if I substitute esm for cjs.

A workaround is to do this instead, but I'd rather know how to do it without:

import { v3 } from "node-hue-api";

v3.api.createLocal();

from node-hue-api.

pindab0ter avatar pindab0ter commented on July 18, 2024

Specifying Api as a return type was giving me trouble. The solution was this:

import { discovery, v3 } from "node-hue-api";
import { Api } from "node-hue-api/dist/esm/api/Api";

What threw me off was having to import Api which was specified in the file Api which was a part of the folder api.

I would suggest improving this.

from node-hue-api.

Related Issues (20)

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.