gluon icon indicating copy to clipboard operation
gluon copied to clipboard

Mac support for browser installed via homebrew

Open lakuapik opened this issue 2 years ago • 11 comments
trafficstars

I installed my browser (firefox and chrome) via homebrew, when i run the gluworld example. i got error:

image

❯ node .
[Gluon] starting browser...
file:///Users/d/Data/labs/glutonis/node_modules/@gluon-framework/gluon/src/index.js:86
  const [ browserPath, browserName ] = await findBrowserPath(forceBrowser);
                                       ^

TypeError: (intermediate value) is not iterable
    at startBrowser (file:///Users/d/Data/labs/glutonis/node_modules/@gluon-framework/gluon/src/index.js:86:40)
    at async Module.open (file:///Users/d/Data/labs/glutonis/node_modules/@gluon-framework/gluon/src/index.js:114:19)
    at async file:///Users/d/Data/labs/glutonis/index.js:38:19

lakuapik avatar Jan 03 '23 02:01 lakuapik

image Can replicate

tristancamejo avatar Jan 03 '23 02:01 tristancamejo

What node version are you using?

tristancamejo avatar Jan 03 '23 02:01 tristancamejo

The examples seem to be using v19 image

tristancamejo avatar Jan 03 '23 02:01 tristancamejo

What node version are you using?

v16.17.0

lakuapik avatar Jan 03 '23 02:01 lakuapik

I'm going to try 19, I'll let you know how it goes.

tristancamejo avatar Jan 03 '23 02:01 tristancamejo

Same problem

tristancamejo avatar Jan 03 '23 02:01 tristancamejo

The issue is with the path for the Homebrew apps folders. Currently available paths by default:

  darwin: {
    chrome: '/Applications/Google Chrome.app/Contents/MacOS/Google Chrome',
    ...
  }

artamonovtech avatar Jan 03 '23 06:01 artamonovtech

@artamonovtech would it not be possible to find the executables from the PATH environment variable? Something like the which npm package.

(Or the code if you don't want to add another dependency)

bolshoytoster avatar Jan 03 '23 11:01 bolshoytoster

Gluon already has support for starting browsers in path. Are Mac browsers (installed via homebrew) in path?

CanadaHonk avatar Jan 03 '23 11:01 CanadaHonk

@CanadaHonk i believe its not:

image

lakuapik avatar Jan 03 '23 13:01 lakuapik

I chose to install Firefox from Homebrew:

Screenshot 2023-01-03 at 23 02 01

Full path:

/Applications/Firefox.app/Contents/MacOS/firefox

artamonovtech avatar Jan 03 '23 17:01 artamonovtech

Seems to be resolved with last path finding rewrite.

CanadaHonk avatar Jan 20 '23 20:01 CanadaHonk