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

Static getter in a class results in SyntaxError with esm 3.2.23 #804

Closed
Tronil opened this issue May 16, 2019 · 9 comments
Closed

Static getter in a class results in SyntaxError with esm 3.2.23 #804

Tronil opened this issue May 16, 2019 · 9 comments
Labels

Comments

@Tronil
Copy link

Tronil commented May 16, 2019

The following can no longer be loaded with the 3.2.23 release:

export class Foo
{
    static get bar()
    {
        return "Foo";
    }
}

If you try you get:

static get bar()
               ^

SyntaxError: Invalid or unexpected token
    at Object.Module._extensions..js (module.js:664:10)

It works with 3.2.22.

@PazzaVlad
Copy link

Have the same problem

@ptb
Copy link

ptb commented May 16, 2019

I'm having a similar issue, works with 3.2.22 but not 3.2.23:

node_modules/puppeteer/lib/Page.js:44
    static async create(client, target, ignoreHTTPSErrors, defaultViewport, screenshotTaskQueue) {
                 ^

  SyntaxError: Invalid or unexpected token

@jdalton
Copy link
Member

jdalton commented May 16, 2019

Yep, super sorry about that folks. Updated parsing support and missed smth. Will have it fixed in the next few hours.

@dnalborczyk
Copy link
Contributor

dnalborczyk commented May 16, 2019

thanks guys for taking the time to report! looks like a regression.

@jdalton the following fail with v3.2.23.:

class Foo {
  static get bar() {}
  static set bar(val) {}
  static async afunc() {}
  static *gfunc() {}
  static async *agfunc() {}
}

@dnalborczyk
Copy link
Contributor

@jdalton uups, same time. 😄 btw, not sure if you noticed. the git release tags are tagged as 3.2.33 as supposed to 3.2.23.

@jdalton
Copy link
Member

jdalton commented May 16, 2019

esm v3.2.24 is released 🎉

@exogen
Copy link

exogen commented May 16, 2019

Thanks for the fix @jdalton! I'm noticing some cases are still having trouble however.

$ node -r esm
> require('node-fetch')
/Users/brian.beck/Projects/node_modules/node-fetch/lib/index.js:899
	[Symbol.iterator]() {
                  ^

SyntaxError: Invalid or unexpected token

(that [Symbol.iterator]() method is on a class)

works fine on 3.2.22 and without esm!

@jdalton
Copy link
Member

jdalton commented May 16, 2019

I'll throw that into the test mix too : )

@andrewgremlich
Copy link

Ditto to @exogen comment with the same error.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Development

No branches or pull requests

7 participants