esm-dev / esm.sh

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

filename too long #334

Closed sachinraja closed 3 weeks ago

sachinraja commented 2 years ago

This import isn't ideal, but it doesn't seem like this error should be happening either:

https://esm.sh/trpc-swr@0.1.0?alias=swr:https%3A%2F%2Fesm.sh%2Fswr%401.3.0%3Fdeps%3Dreact%4018,@trpc/server:https%3A%2F%2Fesm.sh%2F%40trpc%2Fserver%4010.0.0-alpha.22,@trpc/client:https%3A%2F%2Fesm.sh%2F%40trpc%2Fclient%4010.0.0-alpha.22%3Fdeps%3D%40trpc%2Fserver%4010.0.0-alpha.22&deps=react@18

results in:

/* esm.sh - error */
throw new Error("[esm.sh] " + "stat /esms/builds/v82/trpc-swr@0.1.0/X-YS9AdHJwYy9jbGllbnQ6aHR0cHM6Ly9lc20uc2gvQHRycGMvY2xpZW50QDEwLjAuMC1hbHBoYS4yMj9kZXBzPUB0cnBjL3NlcnZlckAxMC4wLjAtYWxwaGEuMjIsQHRycGMvc2VydmVyOmh0dHBzOi8vZXNtLnNoL0B0cnBjL3NlcnZlckAxMC4wLjAtYWxwaGEuMjIsc3dyOmh0dHBzOi8vZXNtLnNoL3N3ckAxLjMuMD9kZXBzPXJlYWN0QDE4CmQvcmVhY3RAMTguMS4w/es2022: file name too long");
export default null;
renhiyama commented 1 year ago

@sachinraja when aliasing, you need to use package name only, with version being optional. You used https link that links to the package on esm.sh, and thats the wrong way to alias a package. Fixing the problem will not make this error.

renhiyama commented 1 year ago

@ije you can go forward and close this?

sachinraja commented 1 year ago

that's not true. I need to use the url so I can specify the react dep for that

renhiyama commented 1 year ago

that's not true. I need to use the url so I can specify the react dep for that

According to the docs, aliasing works as ?alias=react:preact/compat or similar. Instead you're linking it as ?alias=react:<url encoded url like https://esm.sh/preact/compat This won't work. Please fix your URL scheming.

ije commented 3 weeks ago

i believe this has been fixed, thanks