You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Use the tsconfig.json as generated by @kinvolk/headlamp-plugin upgrade
In tsconfig compilerOptions set "strict" to true.
Run npm run tsc
Result: errors on import of third party lib such as MUI.
Now set compilerOptions.paths to {} and run tsc again
Result: no errors MUI imports.
I think it is the wildcard path "*" which is causing this issue. I have put this path to [''] in tsconfig as a workaround.
getAllowedNamespaces
In plugin development (e.g. Kubescape plugin) we use the method getAllowedNamespaces.
Visual Code suggests the import address for this method is '@kinvolk/headlamp-plugin/lib/lib/k8s/cluster';
On running the app this gives an error: getAllowedNamespace is undefined.
After changing the import to '@kinvolk/headlamp-plugin/lib/k8s/cluster' (one lib, not two) the app works fine. Changing k8s to uppercase does not help.
Adding the following line to compilerOptions in the plugin tsconfig.json fixes the issue.
mgalesloot
changed the title
Plugin development: getAllowedNamespaces() import error
Plugin development: import getAllowedNamespaces() is confusing
Mar 23, 2025
mgalesloot
changed the title
Plugin development: import getAllowedNamespaces() is confusing
Plugin development: imports are confusing
Mar 23, 2025
Describe the bug
Plugin development: imports are confusing
Third party imports
npm run tsc
I think it is the wildcard path "*" which is causing this issue. I have put this path to
['']
in tsconfig as a workaround.getAllowedNamespaces
In plugin development (e.g. Kubescape plugin) we use the method getAllowedNamespaces.
Visual Code suggests the import address for this method is
'@kinvolk/headlamp-plugin/lib/lib/k8s/cluster';
On running the app this gives an error:
getAllowedNamespace is undefined
.After changing the import to
'@kinvolk/headlamp-plugin/lib/k8s/cluster'
(one lib, not two) the app works fine. Changingk8s
to uppercase does not help.Adding the following line to compilerOptions in the plugin tsconfig.json fixes the issue.
Environment
Are you able to fix this issue?
No
The text was updated successfully, but these errors were encountered: