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

Lerna bootstrap failure on windows #1818

Closed
Ahmedouu opened this issue Sep 15, 2023 · 12 comments
Closed

Lerna bootstrap failure on windows #1818

Ahmedouu opened this issue Sep 15, 2023 · 12 comments

Comments

@Ahmedouu
Copy link

tried this a few times already on linux and windows and it keeps failing just on windows.

image

@EmiM
Copy link
Contributor

EmiM commented Sep 15, 2023

Could you go to packages/backend and run npm run prepare? It will tell us more what happened. It may be a problem with patch.

@yaronarik
Copy link

yaronarik commented Sep 15, 2023

I had the same issue
The results:

npm run prepare

@vinkabuki
Copy link
Contributor

vinkabuki commented Sep 15, 2023

@Ahmedouu @yaronarik You're missing patch lib.
If you want to bootstrap project and check just the desktop app quick solution is to remove "applyPatches" in prepare script in backend package. applyPatches is just for mobile platforms.

@Ahmedouu
Copy link
Author

@vinkabuki I tried that but prepare keeps failing to run cause of the websockts module:
image

@vinkabuki
Copy link
Contributor

@Ahmedouu It is just a warning, do you see something like "webpack 5.75.0 compiled with 6 warnings in 10857 ms" ? You should, it's the last output line after running npm run prepare

@Ahmedouu
Copy link
Author

Ahmedouu commented Sep 18, 2023

@vinkabuki yeah I see it then I start the desktop package I get this websocket error:

image

then we I try to bootstrap again i get this:
image

so I removed the prepare script and managed to bootstrap with no errors but still got the websocket error when I start the desktop app..

@vinkabuki
Copy link
Contributor

@Ahmedouu Could you please paste the whole output from running npm run prepare in backend (after removing applyPatches from script)

@Ahmedouu
Copy link
Author

Ahmedouu commented Sep 18, 2023

PS C:\Users\USER\projects\quiet\packages\backend> npm run prepare

@quiet/[email protected] prepare
npm run webpack

@quiet/[email protected] webpack
webpack --env mode=development && cp ./lib/bundle.cjs ../backend-bundle/bundle.cjs

assets by path nest/ 38.2 KiB 67 assets
assets by path .ts 633 bytes
asset rn-bridge.d.ts 473 bytes [compared for emit]
asset backendManager.d.ts 122 bytes [compared for emit]
asset index.d.ts 38 bytes [compared for emit]
assets by path __old/registrarTest/
.ts 24 bytes
asset __old/registrarTest/parseRegistrarTestResults.d.ts 12 bytes [compared for emit]
asset __old/registrarTest/torRegistrarTest.d.ts 12 bytes [compared for emit]
asset bundle.cjs 20.3 MiB [compared for emit] (name: bundle)
orphan modules 324 KiB [orphan] 166 modules
runtime modules 4.21 KiB 8 modules
modules by path ./node_modules/ 14 MiB
javascript modules 13.4 MiB
cacheable modules 13.4 MiB 3570 modules
+ 4 modules
json modules 607 KiB 24 modules
modules by path ../ 1.23 MiB 73 modules
modules by path ./src/ 194 KiB
modules by path ./src/nest/ 184 KiB 45 modules
modules by path ./src/*.ts 9.79 KiB
./src/backendManager.ts 4.83 KiB [built] [code generated]
./src/rn-bridge.ts 4.96 KiB [built] [code generated]

  • 34 modules

WARNING in ./node_modules/@nestjs/common/utils/load-package.util.js 9:39-59
Critical dependency: the request of a dependency is an expression
@ ./node_modules/@nestjs/core/nest-application.js 6:28-77
@ ./node_modules/@nestjs/core/index.js 26:21-50
@ ./src/backendManager.ts 3:0-43 33:22-58 72:22-58

WARNING in ./node_modules/@nestjs/core/helpers/load-adapter.js 9:39-63
Critical dependency: the request of a dependency is an expression
@ ./node_modules/@nestjs/core/nest-factory.js 10:23-56
@ ./node_modules/@nestjs/core/index.js 28:21-46
@ ./src/backendManager.ts 3:0-43 33:22-58 72:22-58

WARNING in ./node_modules/@nestjs/core/helpers/optional-require.js 6:39-59
Critical dependency: the request of a dependency is an expression
@ ./node_modules/@nestjs/core/nest-application.js 12:27-64
@ ./node_modules/@nestjs/core/index.js 26:21-50
@ ./src/backendManager.ts 3:0-43 33:22-58 72:22-58

WARNING in ./node_modules/express/lib/view.js 81:13-25
Critical dependency: the request of a dependency is an expression
@ ./node_modules/express/lib/application.js 22:11-28
@ ./node_modules/express/lib/express.js 18:12-36
@ ./node_modules/express/index.js 11:0-41
@ ./src/nest/app.module.ts 21:0-30 129:34-41
@ ./src/backendManager.ts 6:0-46 33:59-79 72:59-79

WARNING in ./node_modules/ws/lib/buffer-util.js 113:23-44
Module not found: Error: Can't resolve 'bufferutil' in 'C:\Users\USER\projects\quiet\packages\backend\node_modules\ws\lib'
@ ./node_modules/ws/lib/websocket.js 31:21-45
@ ./node_modules/ws/index.js 3:18-44
@ ./node_modules/socket.io-adapter/dist/index.js 7:18-31
@ ./node_modules/socket.io/dist/index.js 42:28-56
@ ./node_modules/socket.io/wrapper.mjs 1:0-33 3:43-45
@ ./src/nest/app.module.ts 25:0-47 67:39-47
@ ./src/backendManager.ts 6:0-46 33:59-79 72:59-79

WARNING in ./node_modules/ws/lib/validation.js 117:24-49
Module not found: Error: Can't resolve 'utf-8-validate' in 'C:\Users\USER\projects\quiet\packages\backend\node_modules\ws\lib'
@ ./node_modules/ws/lib/sender.js 11:30-53
@ ./node_modules/ws/index.js 8:19-42
@ ./node_modules/socket.io-adapter/dist/index.js 7:18-31
@ ./node_modules/socket.io/dist/index.js 42:28-56
@ ./node_modules/socket.io/wrapper.mjs 1:0-33 3:43-45
@ ./src/nest/app.module.ts 25:0-47 67:39-47
@ ./src/backendManager.ts 6:0-46 33:59-79 72:59-79

6 warnings have detailed information that is not shown.
Use 'stats.errorDetails: true' resp. '--stats-error-details' to show it.

webpack 5.75.0 compiled with 6 warnings in 13907 ms
'cp' is not recognized as an internal or external command,
operable program or batch file.

@vinkabuki

@vinkabuki
Copy link
Contributor

@Ahmedouu
Replacing webpack script with this "webpack --env mode=development && xcopy .\lib\bundle.cjs ..\backend-bundle\bundle.cjs" and running npm run prepare (modified, without applyPatches) should solve the problem

@vinkabuki vinkabuki moved this from Next Sprint to In progress in Quiet Sep 26, 2023
@vinkabuki vinkabuki self-assigned this Sep 26, 2023
@EmiM EmiM self-assigned this Sep 27, 2023
@EmiM
Copy link
Contributor

EmiM commented Oct 2, 2023

Most of the scripts are Windows-friendly now: #1870

Notes:

  • there may be a problem with applying patch on Windows (npm run applyPatches in packages/backend) - if git apply fails or running desktop throws "Electron failed to install correctly" one needs to modify electron-fetch lib file according to electron-fetch-git.patch and rerun webpack in backend (npm run webpack) before running dev desktop again.
  • I did not focus on mobile development of Quiet on Windows - it may not work for now
  • I generally recommend using powershell but bootstrap has been adjusted to also work in cmd.

@EmiM EmiM moved this from In progress to Waiting for review in Quiet Oct 2, 2023
@EmiM EmiM moved this from Waiting for review to Merged (develop) in Quiet Oct 2, 2023
@siepra siepra changed the title lerna bootstrap failure on windows Lerna bootstrap failure on windows Oct 3, 2023
@Ahmedouu Ahmedouu closed this as completed Oct 3, 2023
@Kacper-RF Kacper-RF moved this from Merged (develop) to Done in Quiet Oct 9, 2023
@EmiM
Copy link
Contributor

EmiM commented Oct 9, 2023

Sorry but we have to revert those changes: #1937
Windows binary is not being built properly on CI right now and we would have to investigate it more deeply. My guess is that it's because of the not-always-working patch in the backend package.
I recommend using git-bash or wsl to develop on Windows machine for now.

@Ahmedouu
Copy link
Author

I see, no worries, I use both just prefer windows.

Thanks,

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
Archived in project
Development

No branches or pull requests

5 participants