proskomma-core 0.9.3 → 0.9.4

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (3) hide show
  1. package/README.md +26 -0
  2. package/dist/index.js +1 -1
  3. package/package.json +10 -9
package/README.md CHANGED
@@ -25,3 +25,29 @@ node do_graph.js ../test/test_data/usfm/hello.usfm example_query.txt
25
25
 
26
26
  # Documentation
27
27
  See the project's [ReadtheDocs](https://doc.proskomma.bible)
28
+
29
+ ___
30
+
31
+ ## Using this package with ReactJS or anything that uses a browser
32
+
33
+ ### "Module not found: Error: Can't resolve 'crypto'" (or any modules)
34
+
35
+ If you run into this problem it's because you're using Webpack 5.
36
+
37
+ Know that for the v5 of this package, you'll **need to** explicitly tell it were to find this `crypto` package and many other packages.
38
+ Please see this for more details : https://webpack.js.org/configuration/resolve/#resolvefallback
39
+
40
+ tldr : packages like `buffer` or `crypto` (for e.g.) are no longer automatically handled when you're using your app in a browser (that's what we call `polyfill`), so you have to load them yourself in your package.
41
+
42
+ Method to solve this problem :
43
+ * check in your `webpack.js`
44
+ * find the section `resolve { fallback ...`
45
+ * if it's not there, create it like in [this webpack.prod.js](./webpack.prod.js)
46
+ * add the line `theNameOfTheNeededPackage: false`
47
+ * try to run you app
48
+ * if you have the same error
49
+ * try to find the right package in npm and install it (e.g. : for `crypto` you'll need `crypto-browserify`)
50
+ * normally it's listed in the link above
51
+ * then replace `false` by `require.resolve('theNameOfTheNeededPackage')`
52
+
53
+ If it doesn't work, I'm afraid you'll have to dig in the webpack documentation for `resolve` : https://webpack.js.org/configuration/resolve/ (or try to find a solution on StackOverflow !)