[ ] terminal: ReferenceError: require is not defined
[x] 0.0.9 bare unobfuscated export of just deps. Fails in stackblitz, codesandbox, glitch
[ ] stackblitz
[ ] codesandbox
[ ] glitch
[ ] 0.0.10 bare unobfuscated unoptimized export of just deps.
[ ] stackblitz: missing packages
[ ] codesandbox: TypeError: Cannot read property 'replace' of undefined
[ ] glitch: Uncaught ReferenceError: process is not defined
[x] 0.0.11 bare unobfuscated unoptimized export without sodium native
[ ] stackblitz: missing packages
[ ] codesandbox: process.binding is not supported
[ ] glitch: Uncaught ReferenceError: process is not defined
[ ] terminal: Error: process.binding is not supported
[x] 0.0.14 bare unobfuscated unoptimized export without sodium native or tar
[x] terminal: working
[x] stackblitz: ok (if install 'events' and 'long')
[x] codesandbox: ok
[ ] glitch: Uncaught ReferenceError: process is not defined
working in all but glitch, as process not available for some reason.
[x] 0.0.15 add webpack optimization config
[ ] terminal:
[x] stackblitz: ok (if install 'events' and 'long')
[x] codesandbox: ok
[ ] glitch: Uncaught ReferenceError: process is not defined
[x] 0.0.16 add obfuscator
[x] terminal: ok
[x] stackblitz: ok (if install 'events' and 'long')
[x] codesandbox: ok
[ ] glitch: Uncaught ReferenceError: process is not defined
[x] 0.0.17 add sodium-native
[x] stackblitz: ok (if install 'events' and 'long')
[ ] codesandbox: Could not find module in path: 'assert/assert.js'
[ ] glitch: Uncaught ReferenceError: process is not defined
[x] 0.0.18 remove target: 'node' from webpack.config.js
[x] stackblitz: ok (if install 'events' and 'long')
[ ] codesandbox: Could not find module in path: 'assert/assert.js'
[ ] glitch: Uncaught ReferenceError: process is not defined
[x] 0.0.19 set externalsPresets: { web: true } in webpack.config.js
(no change)
[x] 0.0.21 add node polyfills, and use package.json for excludes
(no change)
[x] 0.0.23 remove sodium-native
(no change)
console logged every bundled library in codeblitz - worked fine, so must be deeper causes that are throwing
[x] 0.0.24 dual web & node targets in webpack, obfuscator on
[x] stackblitz: ok (if install 'events' and 'long')
[ ] codesandbox: Could not find module in path: 'util/util.js'
[ ] glitch: Uncaught ReferenceError: process is not defined
[ ] codesandbox: Could not find module in path: 'util/util.js'
[ ] glitch: Uncaught ReferenceError: process is not defined
[ ] 0.0.29 web target only with vendor bundle
[ ] stackblitz:
[ ] codesandbox:
[ ] glitch:
Seems almost as if no polyfills being added to interblock dependencies by the live editor loaders. Learned that webpack 5 no longer polyfills node basics, but have a plugin to handle this in theory.
In conclusion, running in live editors is harsh to troubleshoot as we cannot see how their bundlers work. It is fair to assume that they expect web compatible modules to be used, tho. The problem appears to be because the live editors are not shimming node internal libraries before rendering in the browser.
Split out serverside modules such as dynamodb-lock-client into their own packages, to make a pure browser based package
Make a vendor bundle with all interblock dependencies bundled in web compatible form - this will test if the live editor bundlers would have been able to bundle this codebase too. Must only obfuscate our primary bundle.
working in all but glitch, as process not available for some reason.
Seems almost as if no polyfills being added to interblock dependencies by the live editor loaders. Learned that webpack 5 no longer polyfills node basics, but have a plugin to handle this in theory.
In conclusion, running in live editors is harsh to troubleshoot as we cannot see how their bundlers work. It is fair to assume that they expect web compatible modules to be used, tho. The problem appears to be because the live editors are not shimming node internal libraries before rendering in the browser.
Options for further progress: