You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
After playing more with it, I found that using commonjs-everywhere cannot turn the node.js module to a browser-compatible JS library, at least not a standard (i.e. browser independent) one. I observed 2 issues:
In the generated escodegen.browser.js file, there is one occurrence of 'setImmediate()' function which is only supported by IE / Edge, not Chrome or Firefox.
In the generated escodegen.browser.js file, there is one occurrence of 'require(...)' function, which is not standard JS code.
I ended up using another tool 'browserify' to convert the js file and it worked perfectly on my Chrome. Haven't tried it on other browsers yet but it should not too much of an issue.
README.RD and package.json may be updated to include this recommendation.
I figured it out and the reasons:
A. escodegen build depend on the 'cjsify' tool which is part of the commonjs-everywhere npm package.
B. The npm installed version of escodegen does not have the tools/ folder, which the build requires.
These details are currently not specified in the README.MD file. I recommend to add the following to the file:
This will make it more clear for new users.
The text was updated successfully, but these errors were encountered: