Came out of Hybrid Console Scrum on 09/08/2021 Description of problem: ACM is having issues loading the ConsoleRemotePlugin for Webpack since the dynamic plug does not use commonjs. Additional info: The Console team hasn't seen this since they use ts-node, but ts-node should not be required.
Hi Kim, From the bug description it seems only ACM team is having some issues, is this something I can verify from QE side?
I would double check with Vojtech, but since this is part of the build process, there may not be much to check.
Moving to POST since there is one more PR related to this bug: https://github.com/openshift/console/pull/10242
Hi @yapei, to verify this bug, you can inspect the generated content of SDK dist package @openshift-console/dynamic-plugin-sdk-webpack
Hi Yadan, to verify this bug, you can inspect the generated content of SDK dist package @openshift-console/dynamic-plugin-sdk-webpack $ git clone https://github.com/openshift/console $ cd console/frontend ; yarn # this also builds all SDK dist packages $ cd packages/console-dynamic-plugin-sdk/dist/webpack In this directory, we can check that all .js files *do not* use ESM style imports and exports: $ grep -r 'import ' --include='*.js' # empty $ grep -r 'export ' --include='*.js' # no static export statements => OK You can also inspect some .js files and check that they use CommonJS style imports and exports: $ cat lib/webpack/ConsoleRemotePlugin.js .. const webpack = require("webpack"); => this is CommonJS style import .. exports.ConsoleRemotePlugin = ConsoleRemotePlugin; => this is CommonJS style export ..
yapei-mac:dist yapei$ git clone xxxx yapei-mac:dist yapei$ cd console/frontend yapei-mac:frontend yapei$ yarn yarn install v1.22.15 [1/5] 🔍 Validating package.json... [2/5] 🔍 Resolving packages... warning Resolution field "minimist.5" is incompatible with requested version "minimist.8" warning Resolution field "minimist.5" is incompatible with requested version "minimist@~0.0.1" success Already up-to-date. $ yarn generate yarn run v1.22.15 $ yarn generate-graphql && yarn build-plugin-sdk $ graphql-codegen --config graphql-codegen.yml ✔ Parse configuration ✔ Generate outputs $ yarn --cwd packages/console-dynamic-plugin-sdk build $ yarn clean && yarn validate && yarn compile && yarn generate $ rm -rf dist generated $ yarn ts-node scripts/validate-extensions.ts $ ts-node -O '{"module":"commonjs"}' scripts/validate-extensions.ts Validating Console extension types Warnings (42) Extension type 'PVCCreateProp' has no JSDoc com ........ Generating assets for package @openshift-console/dynamic-plugin-sdk-webpack dist/webpack/package.json dist/webpack/LICENSE dist/webpack/README.md dist/webpack/schema ✨ Done in 51.19s. ✨ Done in 53.71s. yapei-mac:dist yapei$ cd packages/console-dynamic-plugin-sdk/dist/webpack yapei-mac:webpack yapei$ find ./ -name *.js | xargs grep 'export ' .//lib/coderefs/coderef-resolver.js: console.error(`Missing module export '${moduleName}.${exportName}' of plugin ${pluginID}`); .//lib/validation/ExtensionValidator.js: this.result.addError(`Invalid module export '${exportName}' ${errorTrace}`); yapei-mac:webpack yapei$ find ./ -name *.js | xargs grep 'import ' All *.js files are using commonJS import and export
Since the problem described in this bug report should be resolved in a recent advisory, it has been closed with a resolution of ERRATA. For information on the advisory (Moderate: OpenShift Container Platform 4.10.3 security update), and where to find the updated files, follow the link below. If the solution does not work for you, open a new bug report. https://access.redhat.com/errata/RHSA-2022:0056