solidity-parser / parser

A Solidity parser for JS built on top of a robust ANTLR4 grammar
MIT License
157 stars 44 forks source link

Import `0.13.2` fail #51

Closed aquiladev closed 3 years ago

aquiladev commented 3 years ago

I have react app. Everything works well with version 0.9.1, but when I installed 0.13.2 import fails

import parser from '@solidity-parser/parser'; as well as import * as parser from '@solidity-parser/parser'; const parser require('@solidity-parser/parser');

error:

TypeError: __webpack_require__(...).join is not a function
   ...

on localhost:

node_modules/@solidity-parser/parser/dist/index.cjs.js:25092
  25089 |   if (typeof BROWSER !== "undefined") {
  25090 |     module2.exports = require_Solidity();
  25091 |   } else {
> 25092 |     module2.exports = require("fs").readFileSync(require("path").join(__dirname, "./antlr/Solidity.tokens")).toString();
  25093 |   }
  25094 | });
  25095 | 

Repo: https://github.com/aquiladev/remix-sol2uml

fvictorio commented 3 years ago

Hi @aquiladev. I think this is the same issue as #47. I'm going to close this one for bookkeeping reasons, but please re-open if you think this is a different issue.