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

v4+ places imports inside parser function, but types using those imports outside #134

Open
ConradHughes opened this issue Nov 14, 2024 · 0 comments

Comments

@ConradHughes
Copy link

When I upgrade from 3.1.0 to any 4.x version, the imports I have in {{ global initialization }} are placed inside the const peggyParser definition. This breaks compilation because type definitions at the end of the generated source file — which need these imports — can't then find imported types. I see no mention of this breaking change in the v4 release notes. Any suggestions please?

As a side note, if I have v4 peggy and v4 ts-pegjs I also get complaints about Cannot find module ts-pegjs/node_modules/prettier/standalone imported from tspegjs.mjs. I assume this is an ESM issue; any workaround for folk stuck (for the time being) on CJS?

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