antlr4 icon indicating copy to clipboard operation
antlr4 copied to clipboard

antlr4 Trees module missing in JS runtime

Open ZengLawrence opened this issue 1 year ago • 3 comments
trafficstars

I am trying import Trees module from JS runtime, but get "Cannot find module 'antlr4/tree/Trees' or its corresponding type declarations" error. See below screenshot.

Screenshot 2024-10-16 at 8 52 55 PM

import Trees from "antlr4/tree/Trees";

Based on the source code Trees.js, I should be able to import use above syntax.

Can someone look into why this module was not packaged into the runtime?

Target runtime: JavaScript / Typescript Runtime version: 4.13.2

ZengLawrence avatar Oct 17 '24 01:10 ZengLawrence

Have you tried import Trees from antlr4 ?Envoyé de mon iPhoneLe 17 oct. 2024 à 03:02, Lawrence Zeng @.***> a écrit : I am trying import Trees module from JS runtime, but get "Cannot find module 'antlr4/tree/Trees' or its corresponding type declarations" error. See below screenshot. Screenshot.2024-10-16.at.8.52.55.PM.png (view on web) import Trees from "antlr4/tree/Trees"; Based on the source code Trees.js, I should be able to import use above syntax. Can someone look into why this module was not packaged into the runtime? Target runtime: JavaScript / Typescript

—Reply to this email directly, view it on GitHub, or unsubscribe.You are receiving this because you are subscribed to this thread.Message ID: @.***>

ericvergnaud avatar Oct 17 '24 10:10 ericvergnaud

Tried import directly from 'antlr4' and got the same error. See below.

import { Trees } from "antlr4";

Screenshot 2024-10-17 at 6 50 15 PM

The problem might be there is no Trees.d.ts type definition for Trees.js. I see all other modules in /tree folder has type definition except Trees.js. See link to folder in repo.

ZengLawrence avatar Oct 17 '24 22:10 ZengLawrence

Ah. Maybe submit a PR?Envoyé de mon iPhoneLe 18 oct. 2024 à 00:55, Lawrence Zeng @.***> a écrit : Tried import directly from 'antlr4' and got the same error. See below. import { Trees } from "antlr4"; Screenshot.2024-10-17.at.6.50.15.PM.png (view on web) The problem might be there is no Trees.d.ts type definition for Trees.js. I see all other modules in /tree folder has type definition except Trees.js. See link to folder in repo.

—Reply to this email directly, view it on GitHub, or unsubscribe.You are receiving this because you commented.Message ID: @.***>

ericvergnaud avatar Oct 19 '24 10:10 ericvergnaud