oracc / nisaba

GNU General Public License v3.0
3 stars 0 forks source link

Warning when packaging #65

Closed ageorgou closed 3 years ago

ageorgou commented 3 years ago

Running npm run package in the current master (29a3cd66) gives a warning:

WARNING in ./node_modules/adm-zip/util/fileSystem.js 5:18-40
Module not found: Error: Can't resolve 'original-fs' in '/Users/ageorgou/oracc/nisaba/node_modules/adm-zip/util'
 @ ./node_modules/adm-zip/util/index.js 2:0-51
 @ ./node_modules/adm-zip/adm-zip.js 1:14-31
 @ ./src/server/mime.ts 5:15-33
 @ ./src/server/messages.ts 14:15-32
 @ ./src/extension.ts 14:19-47

1 warning has detailed information that is not shown.
Use 'stats.errorDetails: true' resp. '--stats-error-details' to show it.

This comes from webpack. It has to do with the original-fs package, which is an Electron-only package that replicates the built-in Node fs. See the same issue reported on adm-zip's tracker.

This should be okay. It makes sense that it happens, because webpack doesn’t know about original-fs . However, the final code is going to run inside a VS Code instance, which will have original-fs.

(What is not clear is why this only happened with merging #54 and not #61, which first used webpack (and was merged first). Maybe the former added extra calls to adm-zip or updated the version of webpack...)

Even fi there is no problem, the warning is distracting. We could either amend our own dependencies (#63) or possibly suppress it through webpack's options. I'm leaning towards the latter.

ageorgou commented 3 years ago

Figured out why the warning didn't come up before merging #54: I had commented out the server communication in #53, and only reenabled it in #54. This was probably the only place where we were using adm-zip.