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

chore: fix webpack command name issue #14067

Merged
merged 1 commit into from
Jun 25, 2024
Merged

chore: fix webpack command name issue #14067

merged 1 commit into from
Jun 25, 2024

Conversation

m1ga
Copy link
Contributor

@m1ga m1ga commented Jun 18, 2024

It looks like the webpack version of Ti is a bit outdated and not compatible with the latest node version.
I quickly tried to run it and the first issue was that it didn't find the connection.

Turns out command.name is a function now and I had to run command.name() to get the command name.

After that it will still fail with

[ERROR] PluginError: Failed to load plugin: Cannot find module 'node:util'
Require stack:
- /usr/local/lib/node_modules/@appcd/plugin-webpack/node_modules/@nuxt/core/node_modules/consola/dist/shared/consola.deac7d5a.cjs
    at Function._resolveFilename (internal/modules/cjs/loader.js:880:15)
    at PluginModule.require (/usr/local/lib/node_modules/appcd/node_modules/appcd-plugin/dist/plugin-module.js:139:22)
    at require (/usr/local/lib/node_modules/appcd/node_modules/appcd-plugin/dist/plugin-module.js:181:36)
    at Object.apply (/usr/local/lib/node_modules/@appcd/plugin-webpack/node_modules/@nuxt/core/node_modules/consola/dist/shared/consola.deac7d5a.cjs:4:19)
    at PluginModule._compile (/usr/local/lib/node_modules/appcd/node_modules/appcd-plugin/dist/plugin-module.js:196:19)
    at Object.Module._extensions..js (internal/modules/cjs/loader.js:1092:10)
    at PluginModule.load (internal/modules/cjs/loader.js:928:32)
    at Function.load (/usr/local/lib/node_modules/appcd/node_modules/appcd-plugin/dist/plugin-module.js:71:11)
    at PluginModule.require (/usr/local/lib/node_modules/appcd/node_modules/appcd-plugin/dist/plugin-module.js:142:23)
    at require (/usr/local/lib/node_modules/appcd/node_modules/appcd-plugin/dist/plugin-module.js:181:36)

but that is not part of this PR as it is in appcd

Copy link
Contributor

@cb1kenobi cb1kenobi left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actually, this is not in appcd, but rather a side effect of Titanium CLI v7. The cli:command-loaded hook emits { cli, command } where command is the Commander.js command instance and Commander.js exposes the name as a function instead of a property!

Anyways, we need this code in order to have full interop with v7. I'm surprised we didn't catch this sooner!

@cb1kenobi cb1kenobi merged commit 420ccdc into master Jun 25, 2024
5 checks passed
@m1ga m1ga deleted the webpackCli branch June 25, 2024 06:45
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants