Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

TypeError: envCompatible.default is not a function #2908

Closed
2 tasks done
fkusei opened this issue Jun 11, 2024 · 4 comments
Closed
2 tasks done

TypeError: envCompatible.default is not a function #2908

fkusei opened this issue Jun 11, 2024 · 4 comments
Labels
BUG Something isn't working

Comments

@fkusei
Copy link

fkusei commented Jun 11, 2024

Is this a bug in companion itself or a module?

  • I believe this to be a bug in companion

Is there an existing issue for this?

  • I have searched the existing issues

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_
@fkusei fkusei added the BUG Something isn't working label Jun 11, 2024
@fkusei fkusei changed the title envCompatible.default TypeError: envCompatible.default is not a function Jun 11, 2024
@Julusian
Copy link
Member

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
Copy link
Author

fkusei commented Jun 13, 2024

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

@Julusian
Copy link
Member

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
Copy link
Author

fkusei commented Jun 18, 2024

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

Thanks for your help!

@fkusei fkusei closed this as completed Jun 18, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
BUG Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants