kubeshop / monokle-core

Monokle validation engine, CLI and shared UI components
MIT License
18 stars 3 forks source link

[Bug]: Problems with brew executable binary #43

Open WitoDelnat opened 2 years ago

WitoDelnat commented 2 years ago

Contact Details

No response

What happened?

The binary works fine and then another time a bit later I run into this error:

~/code/monokle-demo  ▶ monokle validate bundles
node:internal/modules/cjs/loader:936
  throw err;
  ^

Error: Cannot find module '/var/folders/7_/54m525216j753qdynl70gjjh0000gn/T/caxa/applications/monokle/urgds8hcn8/0/build/main.js'
    at Function.Module._resolveFilename (node:internal/modules/cjs/loader:933:15)
    at Function.Module._load (node:internal/modules/cjs/loader:778:27)
    at Function.executeUserEntryPoint [as runMain] (node:internal/modules/run_main:77:12)
    at node:internal/main/run_main_module:17:47 {
  code: 'MODULE_NOT_FOUND',
  requireStack: []
}

brew uninstall monokle-cli && brew install monokle-cli does not solve it. I have to manually go and delete caxa's temporary directory which is an awful experience.

Version

1.0.0 (Default)

Relevant log output

No response

Code of Conduct

WitoDelnat commented 2 years ago

For now we undocumented the brew install and we can revise this once there is more traction towards this.

WitoDelnat commented 1 year ago

NodeJs has a bit a bad reputation in Cloud-Native ecoystem so it's best to solely work with binaries and leave out the npm install. We noticed some bugs on recurrent usage for binary for MacOS. The firsts times it will work! Try it after a while and it stops working with above error.

We could consider vercel/pkg but it does not seem to support ESM (see pinned issues) and I don't think we can compile to CJS because the dynamic imports of plugins. A special NodeJs loader that relies on Base64 urls or node:vm could be an option? To be investigated.