chase / awrit

A full graphical web browser for Kitty terminal with mouse and keyboard support
Other
454 stars 18 forks source link

electron: Module "package.json" needs an import assertion of type "json" #43

Closed jilotta closed 3 months ago

jilotta commented 3 months ago
start electron app...

App threw an error during load
TypeError [ERR_IMPORT_ASSERTION_TYPE_MISSING]: Module "file:///home/jilotta/awrit/awrit-electron/package.json" needs an import assertion of type "json"
    at new NodeError (node:internal/errors:405:5)
    at validateAssertions (node:internal/modules/esm/assert:95:15)
    at defaultLoad (node:internal/modules/esm/load:91:3)
    at nextLoad (node:internal/modules/esm/loader:166:28)
    at ESMLoader.load (node:internal/modules/esm/loader:608:26)
    at ESMLoader.moduleProvider (node:internal/modules/esm/loader:462:22)
    at new ModuleJob (node:internal/modules/esm/module_job:64:26)
    at #createModuleJob (node:internal/modules/esm/loader:485:17)
    at ESMLoader.getModuleJob (node:internal/modules/esm/loader:439:34)
    at async ModuleWrap.<anonymous> (node:internal/modules/esm/module_job:79:21)
A JavaScript error occurred in the main process
Uncaught Exception:
TypeError [ERR_IMPORT_ASSERTION_TYPE_MISSING]: Module "file:///home/jilotta/awrit/awrit-electron/package.json" needs an import assertion of type "json"
    at new NodeError (node:internal/errors:405:5)
    at validateAssertions (node:internal/modules/esm/assert:95:15)
    at defaultLoad (node:internal/modules/esm/load:91:3)
    at nextLoad (node:internal/modules/esm/loader:166:28)
    at ESMLoader.load (node:internal/modules/esm/loader:608:26)
    at ESMLoader.moduleProvider (node:internal/modules/esm/loader:462:22)
    at new ModuleJob (node:internal/modules/esm/module_job:64:26)
    at #createModuleJob (node:internal/modules/esm/loader:485:17)
    at ESMLoader.getModuleJob (node:internal/modules/esm/loader:439:34)
    at async ModuleWrap.<anonymous> (node:internal/modules/esm/module_job:79:21)
chase commented 3 months ago

The electron branch is not functional in any form at the moment, which is why it's not the main branch.

jilotta commented 3 months ago

Oh, thanks. Are the deprecated package warnings going to be fixed?

npm warn deprecated rimraf@3.0.2: Rimraf versions prior to v4 are no longer supported
npm warn deprecated inflight@1.0.6: This module is not supported, and leaks memory. Do not use it. Check out lru-cache if you want a good and tested way to coalesce async requests by a key value, which is much more comprehensive and powerful.
npm warn deprecated glob@7.2.3: Glob versions prior to v9 are no longer supported
npm warn deprecated @humanwhocodes/object-schema@2.0.3: Use @eslint/object-schema instead
npm warn deprecated @humanwhocodes/config-array@0.11.14: Use @eslint/config-array instead
chase commented 3 months ago

These are from upstream packages and will not be fixed.

I'm half tempted to switch to yarn so that people don't bother me with npm's nonsense like this and "security" warnings about packages which in reality have no effect since this isn't code running on a remote server exposed to the internet.

The reason why I don't want to use yarn is because it's another dependency people will require and it's not compatible with electron when packaging.