openfga / language

Grammar for the OpenFGA modeling language
https://openfga.dev
Apache License 2.0
16 stars 7 forks source link

Circular dependency between OpenFGAParser.ts and OpenFGAParserListener.ts #101

Closed adriantam closed 6 months ago

adriantam commented 9 months ago

There is a circular dependency between https://github.com/openfga/language/blob/f944cdcf73ab8db91d6e8b486eed41c944912caa/pkg/js/gen/OpenFGAParser.ts#L14 and https://github.com/openfga/language/blob/f944cdcf73ab8db91d6e8b486eed41c944912caa/pkg/js/gen/OpenFGAParserListener.ts#L9

As a result, using the syntax transformer will result in

OpenFGAParserListener.js:9 Uncaught TypeError: Class extends value undefined is not a constructor or null
    at ./node_modules/@openfga/syntax-transformer/dist/gen/OpenFGAParserListener.js (OpenFGAParserListener.js:9:1)
    at options.factory (react refresh:6:1)
    at __webpack_require__ (bootstrap:24:1)
    at fn (hot module replacement:62:1)
    at ./node_modules/@openfga/syntax-transformer/dist/transformer/dsltojson.js (dsltojson.js:30:1)
    at options.factory (react refresh:6:1)
    at __webpack_require__ (bootstrap:24:1)
    at fn (hot module replacement:62:1)
    at ./node_modules/@openfga/syntax-transformer/dist/transformer/index.js (index.js:17:1)
    at options.factory (react refresh:6:1)