-
-
Notifications
You must be signed in to change notification settings - Fork 184
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
resolve 1.7.0 fails to find bootstrap's package.json #157
Comments
Thanks for the report - I'll look into this and try to publish a patch today. |
OK, so - https://unpkg.com/[email protected]/loader.js is using nonstandard require syntax, which means the webpack loader is kicking in (instead of standard node resolution algorithms, which this package supports). Do you know where that path ( |
Also, have you tried with a non-beta bootstrap-loader version? |
@JVanAartsen thanks; do you know what the value of |
@ljharb whoops, deleted that cuz i convinced myself that was the wrong file. For anyone else following: https://github.com/shakacode/bootstrap-loader/blob/master/src/utils/checkBootstrapVersion.js
|
Are the three dots actually in there, or is that your |
@JVanAartsen so if |
It looks like https://github.com/shakacode/bootstrap-loader/blob/master/src/bootstrap.loader.js#L132-L134 - what's the |
@ljharb yes, three dots are my pwd. not passing bootstrapPath option, so it is undefined. I'm guessing the issue stems from here https://github.com/shakacode/bootstrap-loader/blob/master/src/bootstrap.loader.js#L110 . the |
In that case, it looks like the change might be in https://github.com/shakacode/bootstrap-loader/blob/master/src/utils/resolveModule.js#L14 - I suspect that #146 might be related; @lbogdan, can you weigh in? |
Okay, so for clarity I have a machine that works and a machine that fails with the above message. I have tracked it down to this:
This code, on the working machine, only returns a single package.json file:
However, on the broken machine it returns two:
The weird thing is the "path" for this package (pkgFile) is considered to be:
|
For what it's worth, I am not using the beta branch of that library. I am using the stable 1.0.0 branch. |
Line 89 in bdf1210
should this instead be pkg = opts.packageFilter(pkg, dir) maybe?
|
Okay, so I figured out why the good machine works. It's still package-locked to 1.4.0, where as the broken machine is on 1.7.0. |
@krainboltgreene presumably if you lock it to v1.6 it will continue to work. If there's any chance you could help do a @JVanAartsen it's done twice in lib/async: one two the same way as the line you linked in lib/sync :-/ However, in v1.6, it's passed with It's entirely possible that changing Could either of you help me provide a repro case (a failing test, perhaps in a PR) for this? That would help me ensure I'm fixing the issue you're seeing. |
I might have time for this tonight. |
For what it's worth though, I think you're correct that this is a double edged sword: Both a bug fix and a breaking change. |
For history: Apparently the commit that made the original change in |
I know this can be difficult, but that change really should have warranted a major version bump. |
For a quick workaround add [email protected] to your package.json to lock the version, or upgrade your Node server to latest, seems to fix the issue |
We locked ours to 1.6.0 and things work great. |
@krainboltgreene any chance you could either provide a repro case, or check v1.7.0 with the suggested change, so I can verify that will fix it? |
@JVanAartsen @ljharb
so I don't really see how changing it to |
@lbogdan the problem is that the docs for sync were either wrong or missing previously, and since packageFilter was added, it’s always passed dir as the second argument - i agree that it should have passed pkgfile, but now that people are relying on the wrong behavior, it probably needs to stay broken in the v1 line. |
Agree with @ljharb, v1 should stay with that behaviour. |
v1.7.1 has been released with this fix. 70850d2 restores the "breaking" change and also makes packageFilter take three arguments, so that it's easier to migrate the code that needs "dir" (and will be released in v2). |
Thank you very much! 1.7.1 works great! |
I just fixed a problem of mine by pinning resolve to My projects runs on both server and client, with browserify building a bundle for each. Client build is fine (at least in dev where is the only difference is just watchify), but the server/node build is not. I didn't notice the problem in dev because dev doesn't run the code through browserfiy for the server. Node bundle builds without errors, but upon execution I get the error:
on line
which is in numeral.js (here) and gets included into my app via If you're thinking this doesn't sound related, I'd be inclined to agree, considering the build succeeded and all. But I found this by doing a diff on output of I'm now inspired to make my build process more robust, but any insight here would be appreciated. My browserify (
|
@tybro0103 it may be the same cause as this issue, but it's definitely a different problem - would you mind filing a new issue? |
We're using bootstrap-loader (pinned at version 2.0.0-beta.22) in our webpack configuration to load bootstrap (pinned at version 4.0.0-alpha.6). bootstrap-loader depends on resolve. We were not pinning resolve's version. Our build worked with resolve 1.6.0 but fails with 1.7.0 with this curious error message:
Note that it's looking for
node_modules/bootstrap/package.json/package.json
instead ofnode_modules/bootstrap/package.json
, which is an existing file.The text was updated successfully, but these errors were encountered: