Error when creating minimal JavaScript runtime example

35 views
Skip to first unread message

Grant Simpson

unread,
Dec 22, 2022, 10:03:56 AM12/22/22
to antlr-discussion
Hi all, I am following the instructions at https://github.com/antlr/antlr4/blob/master/doc/javascript-target.md.

When I run webpack, the files generate with no error but within the browser I get the following:

Uncaught TypeError: (0 , t.createRequire) is not a function

My code is simply:
import antlr4 from 'antlr4';

I have tested this under Node 18 and 19, with the same issues.

Anyone haver any insight into what is happening and how to fix it?

eric vergnaud

unread,
Dec 22, 2022, 10:58:47 AM12/22/22
to antlr-discussion
Hi,

this must relate to your packaging settings.
ANTLR runtime does not call createRequire

Eric
n.b. support is now in GitHub discussions

Reply all
Reply to author
Forward
0 new messages