Closed ismay closed 9 years ago
Aha, I figured out what is going on.
They've added the component.json
to their master
branch, but it's not on the latest tagged version. (ie: v4.1.0
)
If you switch to dimsemenov/PhotoSwipe@master
in the interim, it will work. (once they tag a new version, you can go back to using semver)
Ah of course, that makes sense. Thanks for the help!
So just so I understand, duo doesn't fall back to master if there isn't a tagged version with a component.json? I can see how such a fallback would be problematic since you can't always count on there being a master branch, but maybe in that case an error message would help with debugging this kind of issue?
But I don't know whether that fits with Duo's design philosophy. Just a thought.
Duo will fall back to master
if there are no tags. However, it doesn't assume that a missing component.json
is an error if there are already tags available.
As of now, it is kinda complex internally to unwind once the resolution has been completed. Falling back to master
is kind of a hack anyways, which should only happen when there are no tags.
Ah ok, so in this case it's a combination of a missing component.json in the latest tagged version, and a non-standard entry point (i.e. no index.js
).
Yeah, this is a one-time issue for this module. For any versions moving forward, this won't be a problem.
A component.json file was recently added to PhotoSwipe. As far as I can tell it conforms to the component.json spec, and PhotoSwipe has a commonjs export defined.
Photoswipe doesn't have an
index.js
entry point, but thedist/photoswipe.js
entry point is defined in themain
key of it'scomponent.json
. The weird thing is that when I require photoswipe, it gets downloaded to mycomponents
folder, but it isn't included induo.json
.So after the build
PhotoSwipe
isundefined
inindex.js
. Am I doing something wrong here, or is Duo not importing PhotoSwipe correctly?Branch with demonstration of the problem: https://github.com/ismay/ismaywolff.nl/commit/67831fb6ffe45ee6982aa0884ce9b81c08c86e3e