Giter VIP home page Giter VIP logo

Comments (6)

jedwards1211 avatar jedwards1211 commented on May 28, 2024

Does esm.sh support package name self-reference in import/require statements? openai uses package name self-reference (e.g. import * as API from 'openai/resources/index') and an export map with wildcards, so my hunch is there's some issue with how esm.sh handles that.

from esm.sh.

rattrayalex avatar rattrayalex commented on May 28, 2024

I am a maintainer of the openai npm package; this bug is also being discussed here: openai/openai-node#393.

Note that

import OpenAI from "https://esm.sh/[email protected]"

does work, but all more recent versions, including 4.12.0, do not work. The diff from 4.11.0 to 4.12.0 is here: openai/openai-node@v4.11.1...v4.12.0

Though note some of those changes (such as export type -> export import) were later reverted.

There is no resources.js in our codebase, only a resources folder with an index.js. None of our imports attempt to import from eg './resources' without doing './resources/index.js' or equivalent, so I suspect this may be a bug in esm.sh's module resolution magic.

from esm.sh.

rattrayalex avatar rattrayalex commented on May 28, 2024

cc @ije since I think this may be a regression…

from esm.sh.

ije avatar ije commented on May 28, 2024

just deploy a fix patch for the issue, it should work again(also a testing added)

from esm.sh.

ije avatar ije commented on May 28, 2024

sorry for the late update

from esm.sh.

rattrayalex avatar rattrayalex commented on May 28, 2024

Thank you so much @ije !

from esm.sh.

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.