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

Compatibility with Apple Silicon #301

Closed
yhatt opened this issue Nov 23, 2020 · 2 comments · Fixed by #305
Closed

Compatibility with Apple Silicon #301

yhatt opened this issue Nov 23, 2020 · 2 comments · Fixed by #305

Comments

@yhatt
Copy link
Member

yhatt commented Nov 23, 2020

This issue is for tracking Marp CLI compatibility with Apple Silicon M1.

Known issue

Marp CLI on Mac with Apple Silicon cannot spawn the process of Chrome due to misdetection of Chromium browser. It will bring failure while using the conversion into PDF/PPTX/JPG/PNG and the experimental preview mode.

% echo '# Hello' | npx @marp-team/marp-cli -o ./test.pdf
[  INFO ] Converting 1 markdown...
node:events:306
      throw er; // Unhandled 'error' event
      ^

Error: spawn /usr/bin/chromium-browser ENOENT
    at Process.ChildProcess._handle.onexit (node:internal/child_process:269:19)
    at onErrorNT (node:internal/child_process:467:16)
    at processTicksAndRejections (node:internal/process/task_queues:80:21)
Emitted 'error' event on ChildProcess instance at:
    at Process.ChildProcess._handle.onexit (node:internal/child_process:275:12)
    at onErrorNT (node:internal/child_process:467:16)
    at processTicksAndRejections (node:internal/process/task_queues:80:21) {
  errno: -2,
  code: 'ENOENT',
  syscall: 'spawn /usr/bin/chromium-browser',
  path: '/usr/bin/chromium-browser',
  spawnargs: [
    '--disable-background-networking',
    '--enable-features=NetworkService,NetworkServiceInProcess',
    '--disable-background-timer-throttling',
    '--disable-backgrounding-occluded-windows',
    '--disable-breakpad',
    '--disable-client-side-phishing-detection',
    '--disable-component-extensions-with-background-pages',
    '--disable-default-apps',
    '--disable-dev-shm-usage',
    '--disable-extensions',
    '--disable-features=TranslateUI',
    '--disable-hang-monitor',
    '--disable-ipc-flooding-protection',
    '--disable-popup-blocking',
    '--disable-prompt-on-repost',
    '--disable-renderer-backgrounding',
    '--disable-sync',
    '--force-color-profile=srgb',
    '--metrics-recording-only',
    '--no-first-run',
    '--enable-automation',
    '--password-store=basic',
    '--use-mock-keychain',
    '--enable-blink-features=IdleDetection',
    '--user-data-dir=/var/folders/q3/skswxg4x7934y_xc5vjbyhrw0000gn/T/marp-cli-conversion',
    '--headless',
    '--hide-scrollbars',
    '--mute-audio',
    'about:blank',
    '--export-tagged-pdf',
    '--remote-debugging-pipe'
  ]
}
npm ERR! code 1
npm ERR! path /Users/yhatt
npm ERR! command failed
npm ERR! command sh -c marp -o ./test.pdf

npm ERR! A complete log of this run can be found in:
npm ERR!     /Users/yhatt/.npm/_logs/2020-11-23T16_29_17_650Z-debug.log

Confirmed in both of Node 14 for x86 (Running with Rosetta 2) and Node 15 for arm64 native build.

HTML export and watch mode is working correctlly.

@yhatt
Copy link
Member Author

yhatt commented Nov 28, 2020

I've found out it's a Puppeteer's issue: puppeteer/puppeteer#6634

@yhatt yhatt linked a pull request Nov 28, 2020 that will close this issue
@yhatt
Copy link
Member Author

yhatt commented Nov 28, 2020

Applied workaround by patching os.arch() at #305.

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 a pull request may close this issue.

1 participant