oxygenpay/oxygen

ui-payment > build > error

Closed this issue · 12 comments

cd ui-payment
yarn install

[1/4] Resolving packages...
............................

$ husky install
husky - .git can't be found (see https://typicode.github.io/husky/#/?id=custom-directory)
error Command failed with exit code 1.
info Visit https://yarnpkg.com/en/docs/cli/install for documentation about this command.

Hey! Could you describe the use-case for building custom frontend?

Where is custom frontend here? What would be non-custom one then?

Docker image is built with both dashboard UI and payment UI embedded into binary. I assume you want to change something and build the binary by yourself. Hence

Could you describe the use-case for building custom frontend?

Change - not, build by myself - yes. Does it matter?

Does it matter?

Yep, we want to improve developer experience by collecting use-cases outside of the default setup (i.e. running via published docker image).

Regarding your question, you can follow gh action script to reproduce the same build:

  • Put desired vars in .env
  • Run npm ci --ignore-scripts
  • Run npx tsc && npx vite build --base='/p/'

Yep, we want to improve developer experience by collecting use-cases outside of the default setup (i.e. running via published docker image).

Docker is a piece of shit.

% cd ui-payment
%npm ci --ignore-scripts
% npx tsc && npx vite build --base='/p/'
failed to load config from /home/naddika/oxygen/ui-payment/vite.config.ts
error during build:
TypeError: Cannot redefine property: File
    at Function.defineProperty (<anonymous>)
    at Object.<anonymous> (/home/naddika/oxygen/ui-payment/node_modules/@babel/core/lib/index.js:7:8)
    at Module._compile (node:internal/modules/cjs/loader:1241:14)
    at Module._extensions..js (node:internal/modules/cjs/loader:1295:10)
    at Module.load (node:internal/modules/cjs/loader:1091:32)
    at Module._load (node:internal/modules/cjs/loader:938:12)
    at Module.require (node:internal/modules/cjs/loader:1115:19)
    at require (node:internal/modules/helpers:130:18)
    at Object.<anonymous> (/home/naddika/oxygen/ui-payment/node_modules/@babel/core/lib/config/helpers/config-api.js:16:9)
    at Module._compile (node:internal/modules/cjs/loader:1241:14)


% ls vite.config.ts                     
vite.config.ts
 ▸ ~/Code/o2pay/oxygen/ui-dashboard ▸ git:develop ▸ nvm use                                                    
Found '/Users/abc/Code/o2pay/oxygen/ui-dashboard/.nvmrc' with version <16.13.0>
Now using node v16.13.0 (npm v8.1.0)
 ▸ ~/Code/o2pay/oxygen/ui-dashboard ▸ git:develop ▸ npm ci --ignore-scripts 

added 548 packages, and audited 549 packages in 31s

137 packages are looking for funding
  run `npm fund` for details

found 0 vulnerabilities
npm notice 
npm notice New major version of npm available! 8.1.0 -> 10.1.0
npm notice Changelog: https://github.com/npm/cli/releases/tag/v10.1.0
npm notice Run npm install -g npm@10.1.0 to update!
npm notice 
 ▸ ~/Code/o2pay/oxygen/ui-dashboard ▸ git:develop ▸ npx tsc && npx vite build --base='/p/' 
vite v4.4.7 building for production...
✓ 6482 modules transformed.
dist/assets/tron-5b6b6483.svg            0.43 kB │ gzip:   0.31 kB
dist/assets/eth-1f94df85.svg             0.53 kB │ gzip:   0.28 kB
dist/assets/arrow-up-d1a531a7.svg        0.76 kB │ gzip:   0.39 kB
dist/assets/arrow-down-ea43cf9f.svg      0.77 kB │ gzip:   0.39 kB
dist/assets/busd-a6ab749c.svg            0.86 kB │ gzip:   0.47 kB
dist/index.html                          0.90 kB │ gzip:   0.43 kB
dist/assets/matic-479d03ee.svg           1.02 kB │ gzip:   0.48 kB
dist/assets/usdt-337d36c2.svg            1.07 kB │ gzip:   0.52 kB
dist/assets/bnb-d068cbf5.svg             1.61 kB │ gzip:   0.73 kB
dist/assets/usdc-913adf09.svg            1.70 kB │ gzip:   0.70 kB
dist/assets/index-7de3f4c4.css           4.89 kB │ gzip:   1.41 kB
dist/assets/tron-167e02ed.js             0.62 kB │ gzip:   0.43 kB
dist/assets/eth-59de992b.js              0.81 kB │ gzip:   0.40 kB
dist/assets/arrow-up-49a1cfc5.js         0.92 kB │ gzip:   0.52 kB
dist/assets/arrow-down-ba5fc5fb.js       0.94 kB │ gzip:   0.51 kB
dist/assets/busd-88859388.js             1.02 kB │ gzip:   0.55 kB
dist/assets/matic-7f5c3fd9.js            1.21 kB │ gzip:   0.60 kB
dist/assets/usdt-a3321d3c.js             1.31 kB │ gzip:   0.64 kB
dist/assets/bnb-cb17ca65.js              1.69 kB │ gzip:   0.74 kB
dist/assets/usdc-6c2da4e2.js             1.89 kB │ gzip:   0.83 kB
dist/assets/index-78303a53.js        1,565.97 kB │ gzip: 489.28 kB

(!) Some chunks are larger than 500 kBs after minification. Consider:
- Using dynamic import() to code-split the application
- Use build.rollupOptions.output.manualChunks to improve chunking: https://rollupjs.org/configuration-options/#output-manualchunks
- Adjust chunk size limit for this warning via build.chunkSizeWarningLimit.
✓ built in 7.61s
 ▸ ~/Code/o2pay/oxygen/ui-dashboard ▸ git:develop ▸ 

@naddika I want to warn that you attitude is a bit disrespectful.

@swift1337 just a bit? That's ok. I thought it was too much disrespectful.

git:develop

why are you on the develop branch? it's not identical to the master one

the current version of node, which I use too, is 20, whereas you use the 16th

the same error on the develop