react-oidc-context icon indicating copy to clipboard operation
react-oidc-context copied to clipboard

No Version in react-oidc-context\dist\esm\package.json causes warning.

Open BastianTrautmann1992 opened this issue 3 years ago • 1 comments

Directly after installing react-oidc-context and oidc-client-ts I'm getting a warning after npm start.

The warning is:

Compiled with problems:

WARNING in shared module oidc-client-ts -> C:\Users\btrautmann\workspace\timnet-ui\node_modules\oidc-client-ts\dist\esm\oidc-client-ts.js

No version specified and unable to automatically determine one. No version in description file (usually package.json). Add version to description file C:\Users\btrautmann\workspace\timnet-ui\node_modules\oidc-client-ts\dist\esm\package.json, or manually specify version in shared config.

WARNING in shared module react-oidc-context -> C:\Users\btrautmann\workspace\timnet-ui\node_modules\react-oidc-context\dist\esm\react-oidc-context.js

No version specified and unable to automatically determine one. No version in description file (usually package.json). Add version to description file C:\Users\btrautmann\workspace\timnet-ui\node_modules\react-oidc-context\dist\esm\package.json, or manually specify version in shared config.

Anyone having this as well?

BastianTrautmann1992 avatar Sep 23 '22 12:09 BastianTrautmann1992

I do not see this warning, btw in the node_modules\oidc-client-ts\package.json we have the version:

{
  "name": "react-oidc-context",
  "version": "2.1.1",
...

the node_modules\oidc-client-ts\dist\esm\package.json is only thought as a type marker

Which version on npm (npm -v) do you use? I have 8.11.0

pamapa avatar Sep 23 '22 15:09 pamapa

I'm using 8.15.0

BastianTrautmann1992 avatar Sep 27 '22 12:09 BastianTrautmann1992

That means your is newer. I am happy to accept a merge request to fix this. Is it enough to provide a fake version?

pamapa avatar Sep 27 '22 12:09 pamapa

It is completely enough as long the warning is not there anymore :).

BastianTrautmann1992 avatar Sep 27 '22 12:09 BastianTrautmann1992

Please provide a merge request to fix this...

pamapa avatar Sep 27 '22 12:09 pamapa

So the reason this is happening is that in the bundled ESM module there's no "version" attribute in package.json (only "type": "module" there). You can fix that locally in the Federated Plugin by specifying version directly (not to be confused with requiredVersion, which is about the version range that is requested from the NPM, while version is more about the key with which the module is exposed in the shared modules, if I understand correctly).

dantaeusb avatar Sep 27 '23 22:09 dantaeusb

will be fixed in next version, see #936

pamapa avatar Sep 28 '23 06:09 pamapa