Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Adapt Che-Theia to upstream changes (Webpack) #19804

Closed
azatsarynnyy opened this issue May 14, 2021 · 4 comments · Fixed by eclipse-che/che-theia#1134
Closed

Adapt Che-Theia to upstream changes (Webpack) #19804

azatsarynnyy opened this issue May 14, 2021 · 4 comments · Fixed by eclipse-che/che-theia#1134
Assignees
Labels
area/editor/theia Issues related to the che-theia IDE of Che kind/task Internal things, technical debt, and to-do tasks to be performed. severity/P1 Has a major impact to usage or development of the system.
Milestone

Comments

@azatsarynnyy
Copy link
Member

Is your task related to a problem? Please describe.

There are breaking changes made in upstream Theia by the commit eclipse-theia/theia@fa84afa
It breaks Che-Theia build. See the attached logs for the details.

Describe the solution you'd like

Need to adapt Che-Theia to the upstream changes.

Describe alternatives you've considered

Additional context

Che-Theia build output
@eclipse-che/theia-assembly: Failed to resolve module: filenamify
@eclipse-che/theia-assembly: [webpack-cli] Error: Unknown option '--env.cdn=./cdn.json'
@eclipse-che/theia-assembly: [webpack-cli] Run 'webpack --help' to see available commands and options
@eclipse-che/theia-assembly: Error: webpack exited with an unexpected code: 2.\n    at ChildProcess. (/home/theia-dev/theia-source-code/dev-packages/application-manager/lib/application-process.js:67:28)\n    at ChildProcess.emit (events.js:314:20)\n    at maybeClose (internal/child_process.js:1022:16)\n    at Process.ChildProcess._handle.onexit (internal/child_process.js:287:5)
@eclipse-che/theia-assembly: info Visit https://yarnpkg.com/en/docs/cli/run for documentation about this command.
@eclipse-che/theia-assembly: error Command failed with exit code 1.
lerna ERR! execute callback with error
lerna ERR! Error: Command failed: yarn run build
lerna ERR! Failed to resolve module: filenamify
lerna ERR! [webpack-cli] Error: Unknown option '--env.cdn=./cdn.json'
lerna ERR! 
lerna ERR! [webpack-cli] Run 'webpack --help' to see available commands and options
lerna ERR! 
lerna ERR! Error: webpack exited with an unexpected code: 2.
lerna ERR!     at ChildProcess. (/home/theia-dev/theia-source-code/dev-packages/application-manager/lib/application-process.js:67:28)
lerna ERR!     at ChildProcess.emit (events.js:314:20)
lerna ERR!     at maybeClose (internal/child_process.js:1022:16)
lerna ERR!     at Process.ChildProcess._handle.onexit (internal/child_process.js:287:5)
lerna ERR! error Command failed with exit code 1.
lerna ERR! 
lerna ERR! $ theia build --mode production --config cdn/webpack.config.js --env.cdn=./cdn.json --env.monacopkg=@theia/monaco-editor-core@0.20.0 && yarn run override-vs-loader
lerna ERR! info Visit https://yarnpkg.com/en/docs/cli/run for documentation about this command.
lerna ERR! 
lerna ERR!     at /home/theia-dev/theia-source-code/node_modules/execa/index.js:236:11
lerna ERR!     at runMicrotasks ()
Error: Command failed: yarn run build
Failed to resolve module: filenamify
[webpack-cli] Error: Unknown option '--env.cdn=./cdn.json'
[webpack-cli] Run 'webpack --help' to see available commands and options
Error: webpack exited with an unexpected code: 2.
    at ChildProcess. (/home/theia-dev/theia-source-code/dev-packages/application-manager/lib/application-process.js:67:28)
    at ChildProcess.emit (events.js:314:20)
    at maybeClose (internal/child_process.js:1022:16)
    at Process.ChildProcess._handle.onexit (internal/child_process.js:287:5)
error Command failed with exit code 1.
$ theia build --mode production --config cdn/webpack.config.js --env.cdn=./cdn.json --env.monacopkg=@theia/monaco-editor-core@0.20.0 && yarn run override-vs-loader
info Visit https://yarnpkg.com/en/docs/cli/run for documentation about this command.
    at /home/theia-dev/theia-source-code/node_modules/execa/index.js:236:11
    at runMicrotasks ()
    at processTicksAndRejections (internal/process/task_queues.js:97:5) {
  code: 1,
  killed: false,
  stdout: '$ theia build --mode production --config cdn/webpack.config.js --env.cdn=./cdn.json --env.monacopkg=@theia/monaco-editor-core@0.20.0 && yarn run override-vs-loader\n' +
    'info Visit https://yarnpkg.com/en/docs/cli/run for documentation about this command.\n',
  stderr: 'Failed to resolve module: filenamify\n' +
    "[webpack-cli] Error: Unknown option '--env.cdn=./cdn.json'\n" +
    '\n' +
    "[webpack-cli] Run 'webpack --help' to see available commands and options\n" +
    '\n' +
    'Error: webpack exited with an unexpected code: 2.\n' +
    '    at ChildProcess. (/home/theia-dev/theia-source-code/dev-packages/application-manager/lib/application-process.js:67:28)\n' +
    '    at ChildProcess.emit (events.js:314:20)\n' +
    '    at maybeClose (internal/child_process.js:1022:16)\n' +
    '    at Process.ChildProcess._handle.onexit (internal/child_process.js:287:5)\n' +
    'error Command failed with exit code 1.\n',
  failed: true,
  signal: null,
  cmd: 'yarn run build',
  timedOut: false,
  exitCode: 1
}
error Command failed with exit code 1.
info Visit https://yarnpkg.com/en/docs/cli/run for documentation about this command.
error Command failed with exit code 1.
info Visit https://yarnpkg.com/en/docs/cli/install for documentation about this command.
The command '/bin/sh -c if [ -z $GITHUB_TOKEN ]; then unset GITHUB_TOKEN; fi &&     yarn ${YARN_FLAGS}' returned a non-zero code: 1
@azatsarynnyy azatsarynnyy added kind/task Internal things, technical debt, and to-do tasks to be performed. sprint/current severity/P1 Has a major impact to usage or development of the system. team/editors area/editor/theia Issues related to the che-theia IDE of Che labels May 14, 2021
@azatsarynnyy azatsarynnyy added this to the 7.31 milestone May 14, 2021
@azatsarynnyy azatsarynnyy mentioned this issue May 14, 2021
11 tasks
@azatsarynnyy azatsarynnyy changed the title Adapt Che Theia to upstream changes Adapt Che-Theia to upstream changes May 14, 2021
@azatsarynnyy azatsarynnyy self-assigned this May 17, 2021
@azatsarynnyy
Copy link
Member Author

Webpack 4 supports both formats for providing the arguments: --env arg and --env.arg
https://v4.webpack.js.org/api/cli/#environment-options

But Webpack 5 doesn't support the old format --env.arg
https://webpack.js.org/api/cli/#environment-options

Fixed in the PR eclipse-che/che-theia#1105

@azatsarynnyy
Copy link
Member Author

Passing the args to Webpack is fixed. But the welcome page is broken now
image
<img> tags have src='/' instead of base64 encoded images.
I continue the investigation.

@azatsarynnyy azatsarynnyy changed the title Adapt Che-Theia to upstream changes Adapt Che-Theia to upstream changes (Webpack) May 25, 2021
@azatsarynnyy azatsarynnyy modified the milestones: 7.31, 7.32 May 25, 2021
@azatsarynnyy
Copy link
Member Author

detected in the logs:
2021-05-26 14:36:54.892 root ERROR Request getProduct failed with error: mime.getType is not a function Params: TypeError: mime.getType is not a function

@azatsarynnyy
Copy link
Member Author

The fix is proposed in eclipse-che/che-theia#1134

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area/editor/theia Issues related to the che-theia IDE of Che kind/task Internal things, technical debt, and to-do tasks to be performed. severity/P1 Has a major impact to usage or development of the system.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant