Closed pxmage closed 4 years ago
Be able to run in a pure javascript(without node.js) environment.
not working
import 'mercury.web.js' into a non-node.js project.
I was thinking that 'mercury.web.js' is for an environment without Node.js like the browser.
Then I import the 'mercury.web.js' into my React Native project, and it reports an error:
Unable to resolve module `path` from `node_modules/jsdom/lib/api.js`: path could not be found within the project.
So I checked the 'mercury.web.js' and I found some code inside this file like:
require("jsdom")
Obviously, this will not work in the browser nor an environment without node.js.
How do I supposed to use it in such environment?
After a lot of investigations were done, I found it is impossible to run 'jsdom' in React Native environment, I'm closing this.
Expected Behavior
Be able to run in a pure javascript(without node.js) environment.
Current Behavior
not working
Steps to Reproduce
import 'mercury.web.js' into a non-node.js project.
Detailed Description
I was thinking that 'mercury.web.js' is for an environment without Node.js like the browser.
Then I import the 'mercury.web.js' into my React Native project, and it reports an error:
So I checked the 'mercury.web.js' and I found some code inside this file like:
Obviously, this will not work in the browser nor an environment without node.js.
How do I supposed to use it in such environment?