bitfocus / companion

Bitfocus Companion enables the reasonably priced Elgato Stream Deck and other controllers to be a professional shotbox surface for an increasing amount of different presentation switchers, video playback software and broadcast equipment.
http://bitfocus.io/companion
Other
1.57k stars 499 forks source link

TypeError: envCompatible.default is not a function #2908

Closed fkusei closed 3 months ago

fkusei commented 3 months ago

Is this a bug in companion itself or a module?

Is there an existing issue for this?

Describe the bug

When running tools/yarn.sh, the build for the UI (yarn dist:webui) fails:

failed to load config from /opt/bitfocus-companion/webui/vite.config.js
error during build:
TypeError: envCompatible.default is not a function
    at file:///opt/bitfocus-companion/webui/vite.config.js.timestamp-1718091481900-e3121e5b7cf45.mjs:28:26
    at ModuleJob.run (node:internal/modules/esm/module_job:195:25)
    at async ModuleLoader.import (node:internal/modules/esm/loader:337:24)
    at async loadConfigFromBundledFile (file:///opt/bitfocus-companion/node_modules/vite/dist/node/chunks/dep-_QLjGPdL.js:68687:21)
    at async loadConfigFromFile (file:///opt/bitfocus-companion/node_modules/vite/dist/node/chunks/dep-_QLjGPdL.js:68540:28)
    at async resolveConfig (file:///opt/bitfocus-companion/node_modules/vite/dist/node/chunks/dep-_QLjGPdL.js:68150:28)
    at async build (file:///opt/bitfocus-companion/node_modules/vite/dist/node/chunks/dep-_QLjGPdL.js:67285:20)
    at async CAC.<anonymous> (file:///opt/bitfocus-companion/node_modules/vite/dist/node/cli.js:842:9)

Steps To Reproduce

  1. Check out the 3.3.1 git tag
  2. run tools/update.sh

Expected Behavior

install succeeds without issues.

Environment (please complete the following information)

[hostname][/opt/bitfocus-companion] > dpkg -l | grep node
ii  node-semver                            7.1.3-1                           all          Semantic Versioning for Node.js
ii  nodejs                                 18.20.3-1nodesource1              amd64        Node.js event-based server-side javascript engine

[hostname][/opt/bitfocus-companion] > lsb_release -a
No LSB modules are available.
Distributor ID: Ubuntu
Description:    Ubuntu 20.04.6 LTS
Release:        20.04
Codename:       focal

[hostname][/opt/bitfocus-companion] > git status                                           
HEAD detached at v3.3.1                                     
Changes not staged for commit:                              
  (use "git add/rm <file>..." to update what will be committed)                                                         
  (use "git restore <file>..." to discard changes in working directory)                                                 
        modified:   bundled-modules (new commits)                                                                       
        deleted:    module-local-dev/.gitignore             
        deleted:    module-local-dev/package.json           

Untracked files:                                            
  (use "git add <file>..." to include in what will be committed)                                                        
        module-legacy/.yarn/                                
        module-legacy/.yarnrc                               
        module-local-dev/companion-module-knxip/            

no changes added to commit (use "git add" and/or "git commit -a") 


### Additional context

_No response_
Julusian commented 3 months ago

Last time I saw this, was because it had the wrong version of the lib installed. But why that would be happening here I couldn't say. I don't have any ideas on where to begin looking into this, it seems to be fine when run elsewhere

fkusei commented 3 months ago

Is there anything i can try to debug this further? Could this be related to me upgrading from 3.2.2?

Julusian commented 3 months ago

Could this be related to me upgrading from 3.2.2?

Oh yeah, that could be it. Try deleting the node_modules folder at the root, and the ones inside of webui and launcher. Then rerun yarn and try again

fkusei commented 3 months ago

Yes, that fixed it. I've added those instructions to our update checklist :)

Thanks for your help!