Skip to content
New issue

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

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

Already on GitHub? # to your account

[Bug] --inject not work on macos #914

Open
1 of 2 tasks
morganorix opened this issue Feb 9, 2025 · 4 comments · May be fixed by #927
Open
1 of 2 tasks

[Bug] --inject not work on macos #914

morganorix opened this issue Feb 9, 2025 · 4 comments · May be fixed by #927
Labels
bug Something isn't working

Comments

@morganorix
Copy link

morganorix commented Feb 9, 2025

Search before asking

  • 我在 issues 列表中搜索,没有找到类似的内容。
    I searched in the issues and found nothing similar.

Pake version

Version of pake cli : 3.1.1

System version

Version of system : MacOs 15.2

Node.js version

Node.js v20.18.2

Minimal reproduce step

pake "https://chat.mistral.ai/chat" --name "MistralAI" --hide-title-bar --icon ./icon_512.icns --debug true --inject ./inject.js 
PakeAppOptions {
  icon: '/Users/morganorix/Documents/apps maison/mistralai/icon_512.icns',
  width: 1200,
  height: 780,
  useLocalFile: false,
  fullscreen: false,
  hideTitleBar: true,
  multiArch: false,
  inject: './inject.js',
  debug: true,
  proxyUrl: '',
  userAgent: '',
  targets: 'deb',
  appVersion: '1.0.0',
  alwaysOnTop: false,
  darkMode: false,
  disabledWebShortcuts: false,
  activationShortcut: '',
  showSystemTray: false,
  systemTrayIcon: '',
  installerLanguage: 'en-US',
  name: 'MistralAI',
  identifier: 'com.pake.d5f4c2'
}
www.npmjs.com latency is 29 ms
✹ Installing package...

up to date, audited 211 packages in 1s

69 packages are looking for funding
  run `npm fund` for details

✔ Package installed!
✼ The first packaging may be slow, please be patient and wait, it will be faster afterwards.
file:///Users/morganorix/Pake/dist/cli.js:572
        if (!inject.every(item => item.endsWith('.css') || item.endsWith('.js'))) {
                    ^

TypeError: inject.every is not a function
    at mergeConfig (file:///Users/morganorix/Pake/dist/cli.js:572:21)
    at async MacBuilder.buildAndCopy (file:///Users/morganorix/Pake/dist/cli.js:656:9)
    at async MacBuilder.build (file:///Users/morganorix/Pake/dist/cli.js:649:9)
    at async Command.<anonymous> (file:///Users/morganorix/Pake/dist/cli.js:1013:5)
`


### What did you expect to see?

I expect the --inject option to work

### What did you see instead?

`pake "https://chat.mistral.ai/chat" --name "MistralAI" --hide-title-bar --icon ./icon_512.icns --debug true --inject ./inject.js 
PakeAppOptions {
  icon: '/Users/morganorix/Documents/apps maison/mistralai/icon_512.icns',
  width: 1200,
  height: 780,
  useLocalFile: false,
  fullscreen: false,
  hideTitleBar: true,
  multiArch: false,
  inject: './inject.js',
  debug: true,
  proxyUrl: '',
  userAgent: '',
  targets: 'deb',
  appVersion: '1.0.0',
  alwaysOnTop: false,
  darkMode: false,
  disabledWebShortcuts: false,
  activationShortcut: '',
  showSystemTray: false,
  systemTrayIcon: '',
  installerLanguage: 'en-US',
  name: 'MistralAI',
  identifier: 'com.pake.d5f4c2'
}
www.npmjs.com latency is 29 ms
✹ Installing package...

up to date, audited 211 packages in 1s

69 packages are looking for funding
  run `npm fund` for details

✔ Package installed!
✼ The first packaging may be slow, please be patient and wait, it will be faster afterwards.
file:///Users/morganorix/Pake/dist/cli.js:572
        if (!inject.every(item => item.endsWith('.css') || item.endsWith('.js'))) {
                    ^

TypeError: inject.every is not a function
    at mergeConfig (file:///Users/morganorix/Pake/dist/cli.js:572:21)
    at async MacBuilder.buildAndCopy (file:///Users/morganorix/Pake/dist/cli.js:656:9)
    at async MacBuilder.build (file:///Users/morganorix/Pake/dist/cli.js:649:9)
    at async Command.<anonymous> (file:///Users/morganorix/Pake/dist/cli.js:1013:5)

Anything else?

No response

Are you willing to submit a PR?

  • I'm willing to submit a PR!
@morganorix morganorix added the bug Something isn't working label Feb 9, 2025
@ImKujio
Copy link

ImKujio commented Feb 10, 2025

我也遇到了这个问题,应该是参数解析成字符串了而不是数组。

@jeasonnow
Copy link
Collaborator

Image

I used the same command as you, but the inject parameter parsed by commander is an array. Could this be an issue with the commander library?

@coderzc
Copy link

coderzc commented Feb 22, 2025

I've encountered the same problem too.

$ pake https://chat.qwenlm.ai --name QwenChat --icon ~/Downloads/aquv9-bkkex.icns --inject "./1.css" --d
ebug
PakeAppOptions {
  icon: '/Users/zc/Downloads/aquv9-bkkex.icns',
  width: 1200,
  height: 780,
  useLocalFile: false,
  fullscreen: false,
  hideTitleBar: false,
  multiArch: false,
  inject: './1.css',
  debug: true,
  proxyUrl: '',
  userAgent: '',
  targets: 'deb',
  appVersion: '1.0.0',
  alwaysOnTop: false,
  darkMode: false,
  disabledWebShortcuts: false,
  activationShortcut: '',
  showSystemTray: false,
  systemTrayIcon: '',
  installerLanguage: 'en-US',
  name: 'QwenChat',
  identifier: 'com.pake.3a6982'
}
www.npmjs.com latency is 127 ms
✹ Installing package...
✸ Installing package...

added 77 packages, and audited 222 packages in 1s

73 packages are looking for funding
  run `npm fund` for details

✔ Package installed!
✼ The first packaging may be slow, please be patient and wait, it will be faster afterwards.
file:///Users/zc/.nvm/versions/node/v18.20.5/lib/node_modules/pake-cli/dist/cli.js:572
        if (!inject.every(item => item.endsWith('.css') || item.endsWith('.js'))) {
                    ^

TypeError: inject.every is not a function
    at mergeConfig (file:///Users/zc/.nvm/versions/node/v18.20.5/lib/node_modules/pake-cli/dist/cli.js:572:21)
    at async MacBuilder.buildAndCopy (file:///Users/zc/.nvm/versions/node/v18.20.5/lib/node_modules/pake-cli/dist/cli.js:656:9)
    at async MacBuilder.build (file:///Users/zc/.nvm/versions/node/v18.20.5/lib/node_modules/pake-cli/dist/cli.js:649:9)
    at async Command.<anonymous> (file:///Users/zc/.nvm/versions/node/v18.20.5/lib/node_modules/pake-cli/dist/cli.js:1013:5)

Node.js v18.20.5

@kittizz
Copy link

kittizz commented Mar 4, 2025

pake https://chat.kittizz.com --name ChatKT --icon /Users/kittizz/workspace/pake/chat-kt/chatkt.ico --hide-title-bar --inject "/Users/kittizz/workspace/pake/chat-kt/style.css"
✺ Installing package...

up to date, audited 223 packages in 991ms

73 packages are looking for funding
run npm fund for details

✔ Package installed!
✼ macOS icon must be .icns type., but you give .ico
✼ Icon will remain as default.
file:///Users/kittizz/Library/pnpm/global/5/.pnpm/pake-cli@3.1.1/node_modules/pake-cli/dist/cli.js:572
if (!inject.every(item => item.endsWith('.css') || item.endsWith('.js'))) {
^

TypeError: inject.every is not a function
at mergeConfig (file:///Users/kittizz/Library/pnpm/global/5/.pnpm/pake-cli@3.1.1/node_modules/pake-cli/dist/cli.js:572:21)
at async MacBuilder.buildAndCopy (file:///Users/kittizz/Library/pnpm/global/5/.pnpm/pake-cli@3.1.1/node_modules/pake-cli/dist/cli.js:656:9)
at async MacBuilder.build (file:///Users/kittizz/Library/pnpm/global/5/.pnpm/pake-cli@3.1.1/node_modules/pake-cli/dist/cli.js:649:9)
at async Command. (file:///Users/kittizz/Library/pnpm/global/5/.pnpm/pake-cli@3.1.1/node_modules/pake-cli/dist/cli.js:1013:5)

Node.js v22.14.0

# for free to join this conversation on GitHub. Already have an account? # to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging a pull request may close this issue.

5 participants