-
Notifications
You must be signed in to change notification settings - Fork 137
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
@embroider/macros' dependencySatisfies does not understand canary versions #1066
Comments
Please be more specific. We use require('semver').satisfies('4.2.0-alpha.1.canary+ef2ad15f', '>=4.0', { includePrerelease: true })
// true |
I have the same issue with the latest beta. I'll spelunk soon |
nevermind this is resolved with 0.50.0 |
j/k, I still had my patch script running |
I quick threw a (few) console.log in the node_modules/..../dependency-satisfies.js try {
let us = packageCache.ownerOfFile(sourceFileName);
console.log({ us: Boolean(us), name: packageName.value });
if (!us) {
return false;
}
let version = packageCache.resolve(packageName.value, us).version;
console.log({ name: packageName.value, version: Boolean(version) });
return (0, semver_1.satisfies)(version, range.value, {
includePrerelease: true,
});
}
catch (err) {
console.log('catch', { name: packageName.value, range: range.value, error: err.code, sourceFileName });
if (err.code !== 'MODULE_NOT_FOUND') {
throw err;
}
return false;
} It seems the host
|
If you try to manually resolve ember-source from your addon's directory, does it work? You may need to declare a peerdependency on ember-source to guarantee that the addon will be able to resolve it. |
this is an app -- but that kinda makes sense -- I'll have to PR to I just tried adding the peerDep locally (in
Doesn't resolve my surface issue though:
It appears to me that the packageCache.reslove call is missing the version? O.o |
looks like somehow yarn is installing an older version of |
idk what craziness my app's addons are causing, but I've had to add these
my surface issue remains though -- so now I need to figure out why |
so, for reasons unknown to me, I can still only debug with console.log (so painful, idk how people do it), and I added a log of update on the above statement: my VSCode config had a custom terminal profile. reverting to default allows javascript debugging terminal to work and auto-attach. yay! I now see output like this:
and when I
there is no version!
but maybe the tmp location is for all packages that need a compat-adapter. anywho, I
|
I walked into a same kind of problem today. I created a new Ember app (version 4.1.0) and installed an addon which has the latest ember-render-modifier as a requirement. Building the app was no problem, but opening the app I got an error
I was able to trace it down to the line where the check is done which |
@Jopie01 I see that ember-render-modifiers doesn't have a peerDependency on ember-source, which means npm or yarn is free to place ember-source somewhere that ember-render-modifiers can't see it. I just submitted emberjs/ember-render-modifiers#58 for that. I don't think this is a problem with prereleases specifically, I think the dependency isn't being found at all. You can check in the terminal by changing into the directory where ember-render-modifiers is located within node_modules, starting |
Thanks @ef4 for the answer and the PR! I also tried your suggestion:
This gives me |
Huh. So then my guess was wrong and something else is really going on here. |
seems @Jopie01 is running in to what I've been running in to with my project! yay! I'm not crazy! |
No idea if this is giving any information ...... I just added @embroider/macros to my app to try and see what the In the import Route from '@ember/routing/route';
import { dependencySatisfies } from '@embroider/macros';
export default class ApplicationRoute extends Route {
init() {
super.init(...arguments);
console.log(dependencySatisfies('ember-source', '>=4.2.0-alpha.1.canary+ef2ad15f') );
}
} And it gives It also got me thinking and I added |
I can reproduce this myself now, but it's only because we've released #1070 If I forcefully downgrade So I don't see a bug here other than emberjs/ember-render-modifiers#58 |
I |
I'm on But now you are on your own again 🥲 |
@NullVoxPopuli you're talking about a different addon. My PR to |
🤔 util already has ember-source as a peer dep tho, the |
I see other stack trace to ensureSafeComponent, and ember-headlessui doesn't have a passing test suite with embroider: @ef4 how's ember-cli-deprecation-wokflow going to work? |
tried looking at this again, and this I'm not sure how to resolve: so, the place where my dependencySatisfies check is failing is coming from ensure-safe-component, which is actually here: https://github.com/embroider-build/embroider/blob/master/packages/util/app/helpers/ensure-safe-component.js but, does something along the dependency path between util and my app (headless ui, perhaps?) matter? or should it be just |
ah ha! return satisfies(pkg.version, range, {
includePrerelease: true,
}); and here is the a vanilla reproduction: https://runkit.com/nullvoxpopuli/semver satisfies('4.3.1-alpha.1', '>=3.27.0-canary || >=3.27.0-beta', {
includePrelease: true
}) returns false |
so, |
I think I know how to resolve this. PR incoming |
related to: #1057
version is:
DEBUG: Ember : 4.2.0-alpha.1.canary+ef2ad15f
my hunch is that the existing comparison code isn't expecting this many specifiers after alpha.1
The text was updated successfully, but these errors were encountered: