esm-dev / esm.sh

A fast, smart, & global CDN for modern(es2015+) web development.
https://esm.sh
MIT License
3.12k stars 150 forks source link

Failed to import - discord-api-types #594

Closed renhiyama closed 1 year ago

renhiyama commented 1 year ago

The above list is the network graph of importing this package. The last one fails and esm server replies back with:

/* esm.sh - error */
throw new Error("[esm.sh] " + "parseCJSModuleExports: Package path ./utils/v10 is not exported from package /etc/esmd/npm/discord-api-types@0.37.37/node_modules/discord-api-types (see exports field in /etc/esmd/npm/discord-api-types@0.37.37/node_modules/discord-api-types/package.json)");
export default null;

On looking at the package.json file of the package: https://esm.sh/v115/discord-api-types@0.37.37/package.json

// in exports object
        "./utils": {
            "require": "./utils/index.js",
            "import": "./utils/index.mjs",
            "types": "./utils/index.d.ts"
        },
        "./utils/v*": {
            "require": "./utils/v*.js",
            "import": "./utils/v*.mjs",
            "types": "./utils/v*.d.ts"
        }

I think esm.sh must learn about glob support in order to make the last one work?

ije commented 1 year ago

currently the server support pattern like ./utils/*, didn't realize situation in ./utils/v*, will fix asap! thanks

renhiyama commented 1 year ago

Let me know once you push an update! I have to hold off working on my project until then 😅. I should have reported this day before yesterday, only esm.sh provides so much customisation to Target & bundle, and has reasonable approach to everything than other services 🙃

ije commented 1 year ago

Let me know once you push an update! I have to hold off working on my project until then 😅. I should have reported this day before yesterday, only esm.sh provides so much customisation to Target & bundle, and has reasonable approach to everything than other services 🙃

thanks for reporting, it helps a lot

renhiyama commented 1 year ago

@ije esm.sh still shows error for the last link, what should I do/how can I choose a newer build version?

ije commented 1 year ago

will deploy v116 later

renhiyama commented 1 year ago

Any ETA when you will deploy it?

ije commented 1 year ago

tmr it is