expose icon indicating copy to clipboard operation
expose copied to clipboard

syntax error with v2.5.0

Open Gavrisimo opened this issue 2 years ago • 14 comments

Hey there, so I tried upgrading to 2.5.0 and then to share one of my local domains, but I am getting this error:

Parse error: syntax error, unexpected token ")" in phar:///Users/gigi/.composer/vendor/beyondcode/expose/builds/expose/vendor/symfony/finder/Finder.php on line 636

Here is info on php on my machine:

❯ ~ php -v
PHP 8.0.23 (cli) (built: Sep  3 2022 12:20:56) ( NTS )
Copyright (c) The PHP Group
Zend Engine v4.0.23, Copyright (c) Zend Technologies
    with Zend OPcache v8.0.23, Copyright (c), by Zend Technologies

So what I did was I downgraded to 2.4.0 and then it worked:

❯ ~ composer global update
Changed current directory to /Users/gigi/.composer
Loading composer repositories with package information
Updating dependencies
Lock file operations: 0 installs, 1 update, 0 removals
  - Downgrading beyondcode/expose (2.5.0 => 2.4.0)
Writing lock file
Installing dependencies from lock file (including require-dev)
Package operations: 0 installs, 1 update, 0 removals
  - Downgrading beyondcode/expose (2.5.0 => 2.4.0): Extracting archive
Generating autoload files
No security vulnerability advisories found
❯ ~ expose share https://*************.test --domain=local*************.dev --server=us-1
------------------------------------------------------------
          A new Expose Update is available (2.5.0)
             To update run: expose self-update
------------------------------------------------------------
               Thank you for using Expose Pro
------------------------------------------------------------

Shared URL:		*************.test:443
Dashboard:		http://127.0.0.1:4040
Public HTTP:		http://*************.local*************.dev
Public HTTPS:		https://*************.local*************.dev

^C

Then I tried upgrading again to 2.5.0 and running expose but it failed again:

❯ ~ composer global update
Changed current directory to /Users/gigi/.composer
Loading composer repositories with package information
Updating dependencies
Lock file operations: 0 installs, 1 update, 0 removals
  - Upgrading beyondcode/expose (2.4.0 => 2.5.0)
Writing lock file
Installing dependencies from lock file (including require-dev)
Package operations: 0 installs, 1 update, 0 removals
  - Upgrading beyondcode/expose (2.4.0 => 2.5.0): Extracting archive
Generating autoload files
No security vulnerability advisories found
❯ ~ expose share https://*************.test --domain=local*************.dev --server=us-1
PHP Parse error:  syntax error, unexpected token ")" in phar:///Users/gigi/.composer/vendor/beyondcode/expose/builds/expose/vendor/symfony/finder/Finder.php on line 636

Parse error: syntax error, unexpected token ")" in phar:///Users/gigi/.composer/vendor/beyondcode/expose/builds/expose/vendor/symfony/finder/Finder.php on line 636
❯ ~

Gavrisimo avatar Dec 21 '22 10:12 Gavrisimo

Which PHP version do you use?

mpociot avatar Dec 21 '22 10:12 mpociot

@mpociot sorry, I forgot to add that info, I just updated the first post.

❯ ~ php -v
PHP 8.0.23 (cli) (built: Sep  3 2022 12:20:56) ( NTS )
Copyright (c) The PHP Group
Zend Engine v4.0.23, Copyright (c) Zend Technologies
    with Zend OPcache v8.0.23, Copyright (c), by Zend Technologies

Gavrisimo avatar Dec 21 '22 10:12 Gavrisimo

Same problem: PHP Parse error: syntax error, unexpected token ")" in phar:///home/kane/workspace/expose/vendor/symfony/finder/Finder.php on line 636

after:

curl https://github.com/beyondcode/expose/raw/master/builds/expose -L --output expose
chmod +x expose
./expose
$ php -v
PHP 8.0.25 (cli) (built: Oct 28 2022 18:02:51) ( NTS )
Copyright (c) The PHP Group
Zend Engine v4.0.25, Copyright (c) Zend Technologies
    with Zend OPcache v8.0.25, Copyright (c), by Zend Technologies

tomaszkane avatar Dec 22 '22 14:12 tomaszkane

Same for me:

PHP 8.0.25 (cli) (built: Oct 29 2022 01:48:36) ( NTS )
Copyright (c) The PHP Group
Zend Engine v4.0.25, Copyright (c) Zend Technologies
    with Zend OPcache v8.0.25, Copyright (c), by Zend Technologies

roybarber avatar Dec 26 '22 16:12 roybarber

Same issue with PHP 8.0.25

samharvey44 avatar Jan 03 '23 11:01 samharvey44

Same

$ php -v
PHP 8.0.27 (cli) (built: Jan  6 2023 03:55:10) ( NTS )
Copyright (c) The PHP Group
Zend Engine v4.0.27, Copyright (c) Zend Technologies
    with Zend OPcache v8.0.27, Copyright (c), by Zend Technologies

jdempster avatar Jan 12 '23 20:01 jdempster

Also got this on PHP 8.0.x after updating. I've gone back to Expose 2.4.x now and while I'm not getting an error, I'm also not getting any kind of output or a server at all at time of writing, but I guess that's a separate issue...

PHP 8.0.25 (cli) (built: Oct 31 2022 08:58:29) ( NTS )
Copyright (c) The PHP Group
Zend Engine v4.0.25, Copyright (c) Zend Technologies
    with Zend OPcache v8.0.25, Copyright (c), by Zend Technologies

MikePriceAero avatar Jan 13 '23 10:01 MikePriceAero

Same issue for me. Does anyone found a solution yet?

TimFins avatar Jan 27 '23 13:01 TimFins

Also got this on PHP 8.0.x after updating. I've gone back to Expose 2.4.x now and while I'm not getting an error, I'm also not getting any kind of output or a server at all at time of writing, but I guess that's a separate issue...

PHP 8.0.25 (cli) (built: Oct 31 2022 08:58:29) ( NTS )
Copyright (c) The PHP Group
Zend Engine v4.0.25, Copyright (c) Zend Technologies
    with Zend OPcache v8.0.25, Copyright (c), by Zend Technologies

This worked out for me well but as soon as I update PHP from 8.0.X to 8.1.X this won't work out anymore because expose 2.4.X needs a lower php version then 8.1.X

TimFins avatar Jan 27 '23 13:01 TimFins

Same issue for me. Does anyone found a solution yet?

"yes":

{
    "require-dev": {
        "beyondcode/expose": "~2.4.0"
    }
}

:-)

tomaszkane avatar Jan 27 '23 13:01 tomaszkane

Same issue for me. Does anyone found a solution yet?

"yes":

{
    "require-dev": {
        "beyondcode/expose": "~2.4.0"
    }
}

:-)

But then you won't have the latest version of expose. So yes like this it works but is still a kind of workaround. :(

TimFins avatar Jan 27 '23 13:01 TimFins

Oh, https://github.com/beyondcode/expose/blob/2.4.0/composer.json#L19 :-1:

So you can:

  1. wait
  2. try to fix it and do PR
  3. fork and change PHP req. to 8.1 and check if it work
  4. other option :/

tomaszkane avatar Jan 27 '23 14:01 tomaszkane

Having this issue with the hosted version as well, using php 8.0.27, not because I want to, but have to because of other dependencies

johnvoncolln avatar Feb 02 '23 01:02 johnvoncolln

So the main problem is that, while all the dependencies of Expose are backward compatible with PHP 8.0, the bundled PHAR file in 2.5.0 does not work with PHP 8.0 as it was bundled using PHP 8.2 dependencies.

You can manually downgrade your local Expose version to v2.4 like this: composer global update beyondcode/expose:2.4.0

mpociot avatar Feb 16 '23 11:02 mpociot