You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Incorrect redirection leading to not found js #156
I have compared with the vue package and it works there while I have the same architecture.
Am I missing something?
Thanks for help!
Reacted by Matthew Mamonov, Balint Gabor, Vasco Asturiano, David M Sibley, fuzetsu, Samuel Gratzl, Dmitry Kurmanov, Artemiy, Steve Sewell, Jake Trent and 3 more
It seems like unpkg has stopped honoring module and browser properties in package.json
Currently cache MISSes of base package urls evaluate to /index.js
Weirdly enough, we still see some properly cached redirects sitting around from before this behavior.
I haven't traced the line of execution back, but if @jukben is on the right track, it could have something to do with the commit that cleans the package info to cut down on memory usage for the LRU Cache
Until the PR is merged and everything is fixed - hopefully - I bypass the problem (on all my codepen documentation examples) by using the tag @latest followed by direct link of the js file so that I won't need to keep updating the link when I do a new release.
I just wanted to chime in and say that every single one of the packages linked to here seems to be working fine for me. This may be fixed already, and just be CloudFlare caching the broken state. Conversely, this could still be broken, and CloudFlare is somehow caching the non-broken state at the edge location nearest to me.
OK, I just cleared all responses tagged with index-redirect from the CloudFlare cache. This includes all URLs that had fully-resolved version numbers in them, but no file path. This also should fix URLs that used some form of semver or npm tag (also without a file path), because those URLs just redirect to URLs with the absolute version in them.
and here's an example of another lib of mine that specifies a UMD as the pkg.main, where unpkg.com incorrectly serves up the ES Module which is present at /index.js
FWIW, these problems should go away for URLs w/out a version number as soon as the next version is published, because the latest tag will point somewhere else.
Activity
RobinCK commentedon Dec 18, 2018
Similar problem https://unpkg.com/vue-popperjs
smellyshovel commentedon Dec 18, 2018
The same for my https://unpkg.com/vue-custom-context-menu though corresponding part of the
package.jsonis set properlybalazsbajorics commentedon Dec 18, 2018
I have stumbled on the same problem, it seems like the auto resolve that reads package.json is somehow broken
jukben commentedon Dec 18, 2018
Yeah, I've observed the same. The issue is somewhere here because it fallback to https://github.com/unpkg/unpkg.com/blob/19b2e5574b5ab5cb711ddbf27c5300d114bed4dc/modules/middleware/fetchPackage.js#L88 But I can't see it on the first sight 😞
davidmsibley commentedon Dec 18, 2018
It seems like unpkg has stopped honoring
moduleandbrowserproperties in package.jsonCurrently cache MISSes of base package urls evaluate to /index.js
Weirdly enough, we still see some properly cached redirects sitting around from before this behavior.
Edit: Here's the har of two calls illustrating the cache behavior I mentioned: https://gist.github.com/davidmsibley/0e6091aae51aa347c68f10a2f957991f
The first call is a cache MISS for an older version of the package, it responds with the
/index.js, and the second call is a cache HIT for the latest version of the package, resolving the correct path of the.mjsfile. It's not shown here, but calling the first url again results in a cache HIT, redirecting to/index.jsdavidmsibley commentedon Dec 18, 2018
I haven't traced the line of execution back, but if @jukben is on the right track, it could have something to do with the commit that cleans the package info to cut down on memory usage for the LRU Cache
include unpkg (or main) when caching
jgravois commentedon Dec 18, 2018
@davidmsibley's hunch seems reasonable to me. i've proposed an (untested) patch in #157.
TIL:
pkg.browserhasn't been used for awhile.davidmsibley commentedon Dec 18, 2018
@jgravois thanks for working on that!
I think that PR will do the trick. The packageConfig that's passed into filenameRedirect is from the cleaned packageConfig
antoniandre commentedon Dec 19, 2018
Until the PR is merged and everything is fixed - hopefully - I bypass the problem (on all my codepen documentation examples) by using the tag
@latestfollowed by direct link of the js file so that I won't need to keep updating the link when I do a new release.This is how it looks like:
https://unpkg.com/splitpanes@latest/dist/splitpanes.umd.min.js
With this form of link the redirection to latest package file works (redirects to https://unpkg.com/[email protected]/dist/splitpanes.umd.min.js)
bruceCzK commentedon Dec 20, 2018
Still has problem for https://unpkg.com/http-vue-loader
AKPWebDesign commentedon Dec 20, 2018
I just wanted to chime in and say that every single one of the packages linked to here seems to be working fine for me. This may be fixed already, and just be CloudFlare caching the broken state. Conversely, this could still be broken, and CloudFlare is somehow caching the non-broken state at the edge location nearest to me.
Example cURL: https://gist.github.com/AKPWebDesign/f34c8377fabf145d5c2b91e55560157a
danopia commentedon Dec 20, 2018
I just clicked that most recent URL, https://unpkg.com/http-vue-loader, and it is 404ing - also with curl
But the curl for https://unpkg.com/splitpanes does in fact work for me.
Requesting from Los Angeles. I used https://unpkg.com/vue for a semi-production app. :(
dead-claudia commentedon Dec 20, 2018
For unpkg.com/mithril, it's returning the wrong file and causing exceptions since
mithril/index.jsdoes exist (it's just not our"main").antoniandre commentedon Dec 20, 2018
@danopia, Interestingly it still doesn't work from Australia, does https://unpkg.com/splitpanes resolves to the js file in @1.7.0?
I don't understand how it can work in some countries and not others if it's the same code, Also if it's pointing to the version 1.7.0 it means it's not cached how can it not work here then. 🤔
23 remaining items
mjackson commentedon Jan 2, 2019
OK, I just cleared all responses tagged with
index-redirectfrom the CloudFlare cache. This includes all URLs that had fully-resolved version numbers in them, but no file path. This also should fix URLs that used some form of semver or npm tag (also without a file path), because those URLs just redirect to URLs with the absolute version in them.lbogdan commentedon Jan 2, 2019
I can confirm it's fixed here. 👍
Sphinxxxx commentedon Jan 2, 2019
Looks good! All links I had trouble with work again.
jgravois commentedon Jan 2, 2019
thanks @mjackson 🙏.
a user did report an error in an entirely different library that i am (still) able to reproduce.
https://unpkg.com/esri-leaflet-cluster
happy to provide more information if anything else would be useful.
porsager commentedon Jan 2, 2019
I still have issues with https://unpkg.com/mithril (requests from denmark) :(
Sphinxxxx commentedon Jan 2, 2019
If it helps to narrow things down: Both of those (
esri-leaflet-clusterandmithril) work fine from Norway.jgravois commentedon Jan 2, 2019
and here's an example of another lib of mine that specifies a UMD as the
pkg.main, where unpkg.com incorrectly serves up the ES Module which is present at/index.jshttps://unpkg.com/@esri/arcgis-to-geojson-utils
(in Southern California anyway).
mjackson commentedon Jan 3, 2019
@jgravois Just cleared the cache for both of those.
@porsager Just cleared the cache for mithril.
FWIW, these problems should go away for URLs w/out a version number as soon as the next version is published, because the
latesttag will point somewhere else.porsager commentedon Jan 3, 2019
Awesome! Thanks @mjackson - working here now!
karanisverma commentedon Jan 4, 2019
facing same issue with
https://unpkg.com/@zoomcarindia/zcui-wc-search-widget (india)
karanisverma commentedon Jan 4, 2019
it's working now 😂
jhildenbiddle commentedon Jan 5, 2019
Thanks @mjackson. Very much appreciated.
(Hope this didn't ruin your holidays!)
rogeru commentedon Jan 10, 2019
Same issue for https://unpkg.com/circuit-sdk from some location.