-
Notifications
You must be signed in to change notification settings - Fork 147
repro for issue #366 #369
Comments
That's fine because it's telling App2 that its cache (when it does run) is dirty.
I cannot repro that. If I make App2 pin at If App2 used I can handle this in a couple ways.
|
sorry, I literally meant higher or lower, not same (should have emphasized) what I'm lacking is the misunderstanding that the mere presence of a package.json file in another folder has an effect on how the file is being loaded with esm. though I have no knowledge on what node itself does (without using esm). meaning, if I "cjs" require from a folder with a package.json, is node interested in anything from package.json (besides the "main" field, if specified)? |
just re-reading your comments. is the reason esm is looking for a package.json dependency in the folder of the file being loaded to make sure that the features are supported by the esm version the root app is using? btw, if esm is being specified as a dev-dependency in package.json (which I'm doing for e.g. loading an ESM version of webpack.config) in app2 then there's no error. |
maybe my misunderstanding is also related to the intended usage for module packages. e.g lodash/lodash#3745 I suppose you'd make the lodash entry point for cjs consumers with esm. if someone wants to use the ESM modules of lodash v5, I suppose they would need to use esm -- for the time being -- unless you're going with *.mjs. assuming someone would be referencing: import { pick } from "lodash"
// or
import pick from "lodash/pick" why would esm [loaded from the root app] care about the esm module in dependencies which is only loaded (and meant) for the cjs consumers to create an entry point in lodash? |
You're a bit all over the place with this so I'll just brain dump how it is. The loader is mimicking how npm deps work. By pinning to a specific version you are stating only run that version. That said I can gate to the classic semver |
btw, just to make sure, I'm not arguing for anything, just trying to understand. yeah, I know how npm does semver (to a certain degree). but that's not so much the issue. I also don't know what action esm should take on matters of ^, ~, or *. I have no opinion on that. I haven't thought about it, since I don't understand why the version information is being taken into consideration in the first place 😃 what it comes down to is: Maybe it's some inner workings of esm I'm not aware of. just added, maybe that's the misunderstanding: with esm, I was always talking about the loader, not the language feature. maybe I should have been more explicit. |
v3.0.20 is released 🎉 |
@jdalton just looked at #366 again.
repro:
https://github.com/dnalborczyk/esm-issue-366
versions are locked down.
it seems the existence of a package.json file has an effect on the outcome of the import, which I would have not expected either. I thought package.json would only be valued if one wants to import a package without a direct path but with a "main" entry specified.
some observations, which I'm not sure they are intended:
The text was updated successfully, but these errors were encountered: