perses / perses/plugins

Module federation warnings "No required version specified"

Open
#92 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

  • #215 by @andreasgerstmayr — closed without merging
Dominant language
TypeScript
Stars
31
Forks
79
Avg merge
1d 17h
Merged PRs (30d)
41

Description

There are a lot of warnings in the build:

File: /home/runner/work/plugins/plugins/node_modules/@perses-dev/components/dist/Legend/Legend.js:1:1
  ⚠ No required version specified and unable to automatically determine one. Unable to find required version for "immer" in description file/s
  │ /home/runner/work/plugins/plugins/package.json
  │ /home/runner/work/plugins/plugins/node_modules/@perses-dev/components/package.json
  │ It need to be in dependencies, devDependencies or peerDependencies. file: shared module immer
 @ ../node_modules/@perses-dev/components/dist/Legend/index.js
 @ ../node_modules/@perses-dev/components/dist/index.js
 @ consume shared module (default) @perses-dev/components@^0.51.0-beta.0 (strict) (fallback: /home/runner/work/plugins/plugins/node_modules/@perses-dev/components/dist/index.js)
 @ ./src/BarChartOptionsEditorSettings.tsx
 @ ./src/BarChart.ts
 @ container entry
File: /home/runner/work/plugins/plugins/node_modules/@perses-dev/components/dist/ThresholdsEditor/ThresholdsEditor.js:1:1
  ⚠ No required version specified and unable to automatically determine one. Unable to find required version for "immer" in description file/s
  │ /home/runner/work/plugins/plugins/node_modules/@perses-dev/components/package.json
  │ /home/runner/work/plugins/plugins/package.json
  │ It need to be in dependencies, devDependencies or peerDependencies. file: shared module immer
 @ ../node_modules/@perses-dev/components/dist/ThresholdsEditor/index.js
 @ ../node_modules/@perses-dev/components/dist/index.js
 @ consume shared module (default) @perses-dev/components@^0.51.0-beta.0 (strict) (fallback: /home/runner/work/plugins/plugins/node_modules/@perses-dev/components/dist/index.js)
 @ ./src/BarChartOptionsEditorSettings.tsx
 @ ./src/BarChart.ts
 @ container entry
File: /home/runner/work/plugins/plugins/node_modules/@perses-dev/plugin-system/dist/remote/PluginRuntime.js:1:1
  ⚠ No required version specified and unable to automatically determine one. Unable to find required version for "@emotion/styled" in description file/s
  │ /home/runner/work/plugins/plugins/node_modules/@perses-dev/plugin-system/package.json
  │ /home/runner/work/plugins/plugins/package.json
  │ It need to be in dependencies, devDependencies or peerDependencies. file: shared module @emotion/styled
 @ ../node_modules/@perses-dev/plugin-system/dist/remote/remotePluginLoader.js
 @ ../node_modules/@perses-dev/plugin-system/dist/remote/index.js
 @ ../node_modules/@perses-dev/plugin-system/dist/index.js
 @ consume shared module (default) @perses-dev/plugin-system@^0.51.0-beta.0 (strict) (fallback: /home/runner/work/plugins/plugins/node_modules/@perses-dev/plugin-system/dist/index.js)
 @ ./src/BarChartOptionsEditorSettings.tsx
 @ ./src/BarChart.ts
 @ container entry
File: /home/runner/work/plugins/plugins/node_modules/@perses-dev/plugin-system/dist/remote/PluginRuntime.js:1:1
  ⚠ No required version specified and unable to automatically determine one. Unable to find required version for "lodash" in description file/s
  │ /home/runner/work/plugins/plugins/node_modules/@perses-dev/plugin-system/package.json
  │ /home/runner/work/plugins/plugins/package.json
  │ It need to be in dependencies, devDependencies or peerDependencies. file: shared module lodash
 @ ../node_modules/@perses-dev/plugin-system/dist/remote/remotePluginLoader.js
 @ ../node_modules/@perses-dev/plugin-system/dist/remote/index.js
 @ ../node_modules/@perses-dev/plugin-system/dist/index.js
 @ consume shared module (default) @perses-dev/plugin-system@^0.51.0-beta.0 (strict) (fallback: /home/runner/work/plugins/plugins/node_modules/@perses-dev/plugin-system/dist/index.js)
 @ ./src/BarChartOptionsEditorSettings.tsx
 @ ./src/BarChart.ts
 @ container entry
File: /home/runner/work/plugins/plugins/node_modules/@perses-dev/plugin-system/dist/remote/PluginRuntime.js:1:1
  ⚠ No required version specified and unable to automatically determine one. Unable to find required version for "date-fns-tz" in description file/s
  │ /home/runner/work/plugins/plugins/package.json
  │ /home/runner/work/plugins/plugins/node_modules/@perses-dev/plugin-system/package.json
  │ It need to be in dependencies, devDependencies or peerDependencies. file: shared module date-fns-tz
 @ ../node_modules/@perses-dev/plugin-system/dist/remote/remotePluginLoader.js
 @ ../node_modules/@perses-dev/plugin-system/dist/remote/index.js
 @ ../node_modules/@perses-dev/plugin-system/dist/index.js
 @ consume shared module (default) @perses-dev/plugin-system@^0.51.0-beta.0 (strict) (fallback: /home/runner/work/plugins/plugins/node_modules/@perses-dev/plugin-system/dist/index.js)
 @ ./src/BarChartOptionsEditorSettings.tsx
 @ ./src/BarChart.ts
 @ container entry
File: /home/runner/work/plugins/plugins/node_modules/@perses-dev/plugin-system/dist/remote/PluginRuntime.js:1:1
  ⚠ No required version specified and unable to automatically determine one. Unable to find required version for "echarts" in description file/s
  │ /home/runner/work/plugins/plugins/package.json
  │ /home/runner/work/plugins/plugins/node_modules/@perses-dev/plugin-system/package.json
  │ It need to be in dependencies, devDependencies or peerDependencies. file: shared module echarts
 @ ../node_modules/@perses-dev/plugin-system/dist/remote/remotePluginLoader.js
 @ ../node_modules/@perses-dev/plugin-system/dist/remote/index.js
 @ ../node_modules/@perses-dev/plugin-system/dist/index.js
 @ consume shared module (default) @perses-dev/plugin-system@^0.51.0-beta.0 (strict) (fallback: /home/runner/work/plugins/plugins/node_modules/@perses-dev/plugin-system/dist/index.js)
 @ ./src/BarChartOptionsEditorSettings.tsx
 @ ./src/BarChart.ts
 @ container entry

Originally posted by @Nexucis in https://github.com/perses/plugins/pull/73#pullrequestreview-2695834410

description file/s
  │ /home/runner/work/plugins/plugins/package.json
  │ /home/runner/work/plugins/plugins/node_modules/@perses-dev/plugin-system/package.json

I think it looks at the wrong file, shouldn't it look in package.json in the plugin subfolder: https://github.com/perses/plugins/blob/main/barchart/package.json#L29?
Alternatively, I've seen configs where rsbuild.config.ts imports package.json and specifies requiredVersion here: https://github.com/perses/plugins/blob/main/barchart/rsbuild.config.ts#L54

Contributor guide

No contributing guide indexed for this repository

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start by reproducing the plugin build and inspect barchart/package.json near line 29 and barchart/rsbuild.config.ts near line 54. Check how Module Federation determines required versions for the listed shared modules. Done means the build no longer emits these “No required version specified” warnings and the relevant configuration remains correct.

Written by the indexing model from the issue text.

Assessment

Tech stack
typescript, webpack
Domain
build-system
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.