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

Support for the experimental syntax 'classProperties' isn't currently enabled #131

Open
NullVoxPopuli opened this issue Jul 11, 2020 · 2 comments

Comments

@NullVoxPopuli
Copy link
Contributor

NullVoxPopuli commented Jul 11, 2020

Got this error on some of my supporting code

doctor-who-ai/workers/ai/game.js: Support for the experimental syntax 'classProperties' isn't currently enabled (28:8):

  26 | export function fakeGameFrom(model) {
  27 |   class FakeInputManager {
> 28 |     on = voidFn;
     |        ^
  29 |   }
  30 | 
  31 |   class FakeActuator {

Add @babel/plugin-proposal-class-properties (https://git.io/vb4SL) to the 'plugins' section of your Babel config to enable transformation.
If you want to leave it as-is, add @babel/plugin-syntax-class-properties (https://git.io/vb4yQ) to the 'plugins' section to enable parsing.

maybe a bigger question here, is why is this trying to be transpiled anyway? my target browsers (latest chrome and firefox) support class properties?

trace
Add @babel/plugin-proposal-class-properties (https://git.io/vb4SL) to the 'plugins' section of your Babel config to enable transformation.
If you want to leave it as-is, add @babel/plugin-syntax-class-properties (https://git.io/vb4yQ) to the 'plugins' section to enable parsing.
    at Parser._raise (/home/lprestonsegoiii/Development/NullVoxPopuli/doctor-who-thirteen-game-ai/doctor-who-ai/node_modules/@babel/parser/lib/index.js:757:17)
    at Parser.raiseWithData (/home/lprestonsegoiii/Development/NullVoxPopuli/doctor-who-thirteen-game-ai/doctor-who-ai/node_modules/@babel/parser/lib/index.js:750:17)
    at Parser.expectPlugin (/home/lprestonsegoiii/Development/NullVoxPopuli/doctor-who-thirteen-game-ai/doctor-who-ai/node_modules/@babel/parser/lib/index.js:8839:18)
    at Parser.parseClassProperty (/home/lprestonsegoiii/Development/NullVoxPopuli/doctor-who-thirteen-game-ai/doctor-who-ai/node_modules/@babel/parser/lib/index.js:12232:12)
    at Parser.pushClassProperty (/home/lprestonsegoiii/Development/NullVoxPopuli/doctor-who-thirteen-game-ai/doctor-who-ai/node_modules/@babel/parser/lib/index.js:12192:30)
    at Parser.parseClassMemberWithIsStatic (/home/lprestonsegoiii/Development/NullVoxPopuli/doctor-who-thirteen-game-ai/doctor-who-ai/node_modules/@babel/parser/lib/index.js:12125:14)
    at Parser.parseClassMember (/home/lprestonsegoiii/Development/NullVoxPopuli/doctor-who-thirteen-game-ai/doctor-who-ai/node_modules/@babel/parser/lib/index.js:12062:10)
    at /home/lprestonsegoiii/Development/NullVoxPopuli/doctor-who-thirteen-game-ai/doctor-who-ai/node_modules/@babel/parser/lib/index.js:12007:14
    at Parser.withTopicForbiddingContext (/home/lprestonsegoiii/Development/NullVoxPopuli/doctor-who-thirteen-game-ai/doctor-who-ai/node_modules/@babel/parser/lib/index.js:11078:14)
    at Parser.parseClassBody (/home/lprestonsegoiii/Development/NullVoxPopuli/doctor-who-thirteen-game-ai/doctor-who-ai/node_modules/@babel/parser/lib/index.js:11984:10)
@NullVoxPopuli
Copy link
Contributor Author

NullVoxPopuli commented Jul 11, 2020

maybe this is a rollup issue?
looking here: https://github.com/html-next/skyrocket/blob/master/packages/compiler/src/plugin/rollup.ts#L53

looks like babel isn't used? should that be added?

looks like babel is used, but has some weird configuration pulled from somewhere?

@NullVoxPopuli
Copy link
Contributor Author

I can "get past this" but converting my classes to pre class properties myself

eg

  class FakeInputManager {
    constructor() {
      this.on = voidFn;
    }
  }

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

No branches or pull requests

1 participant