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

Typescript example causes error #460

Open
toddobryan opened this issue Sep 18, 2023 · 1 comment
Open

Typescript example causes error #460

toddobryan opened this issue Sep 18, 2023 · 1 comment

Comments

@toddobryan
Copy link

I'm trying to use Ohm with Typescript, following the example, but I keep getting an error:

 TypeError: Cannot read properties of undefined (reading 'createSemantics')

      3 | import grammar, {LangSemantics} from './lang.ohm-bundle'
      4 |
    > 5 | const semantics = grammar.createSemantics()

Using the generate command created the lang.ohm-bundle.js and lang.ohm-bundle.d.ts files correctly, as far as I can tell, but it's just not working.

I'm trying to add this to a fairly large project, and I'll admit that I'm not the most JS/TS proficient person, so I'm just wondering if there are settings in various config files that need to be set a certain way for this to all work. (And if that info could be added to the documentation.)

@mattbruv
Copy link

mattbruv commented Feb 9, 2024

See if this helps you: #462

My PR has been open forever so I don't think they particularly care about this project or the fact that users are experiencing frustration

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

2 participants