saleor / saleor-dashboard

A GraphQL-powered, single-page dashboard application for Saleor.
BSD 3-Clause "New" or "Revised" License
841 stars 1.09k forks source link

Cannot deploy to Vercel #3323

Closed valiukasd closed 1 year ago

valiukasd commented 1 year ago

Description of the issue

I cannot deploy to Vercel due to an error. I think that I have it setup correctly, but correct me if I am wrong. …

Steps to reproduce the problem

  1. Clone the repository and deploy to Vercel
  2. Get error

Expected Result

Deployment is succesful …

Actual Result

Build Failed Command "npm run build" exited with 1 …

Screenshots

image

Console output

[20:44:28.435] Running build in Cleveland, USA (East) – cle1
[20:44:28.486] Cloning github.com/valiukasd/avimeta (Branch: master, Commit: 5ffa6f3)
[20:44:28.493] Skipping build cache, deployment was triggered without cache.
[20:44:31.913] Cloning completed: 3.426s
[20:44:33.557] Running "vercel build"
[20:44:34.002] Vercel CLI 28.16.15
[20:44:34.902] Running "install" command: `npm install`...
[20:46:02.212] 
[20:46:02.213] > saleor-dashboard@3.12.1 postinstall
[20:46:02.213] > node scripts/patchReactVirtualized.js
[20:46:02.213] 
[20:46:02.299] 
[20:46:02.299] > saleor-dashboard@3.12.1 prepare
[20:46:02.300] > is-ci || husky install
[20:46:02.300] 
[20:46:02.435] 
[20:46:02.435] added 3311 packages, and audited 3312 packages in 1m
[20:46:02.436] 
[20:46:02.436] 236 packages are looking for funding
[20:46:02.436]   run `npm fund` for details
[20:46:02.639] 
[20:46:02.639] 75 vulnerabilities (1 low, 23 moderate, 40 high, 11 critical)
[20:46:02.639] 
[20:46:02.639] To address issues that do not require attention, run:
[20:46:02.639]   npm audit fix
[20:46:02.639] 
[20:46:02.640] To address all issues (including breaking changes), run:
[20:46:02.640]   npm audit fix --force
[20:46:02.640] 
[20:46:02.640] Run `npm audit` for details.
[20:46:03.025] 
[20:46:03.025] > saleor-dashboard@3.12.1 prebuild
[20:46:03.025] > npm run build-types
[20:46:03.026] 
[20:46:03.326] 
[20:46:03.327] > saleor-dashboard@3.12.1 build-types
[20:46:03.327] > node scripts/build-types.js
[20:46:03.327] 
[20:46:04.318] [18:46:04] Parse configuration [started]
[20:46:04.319] [18:46:04] Parse configuration [completed]
[20:46:04.320] [18:46:04] Generate outputs [started]
[20:46:04.321] [18:46:04] Generate ./src/graphql/fragmentTypes.generated.ts [started]
[20:46:04.321] [18:46:04] Generate ./src/graphql/typePolicies.generated.ts [started]
[20:46:04.321] [18:46:04] Generate ./src/graphql/types.generated.ts [started]
[20:46:04.321] [18:46:04] Generate to ./src/graphql/hooks.generated.ts (using EXPERIMENTAL preset "import-types") [started]
[20:46:04.322] [18:46:04] Load GraphQL schemas [started]
[20:46:04.322] [18:46:04] Load GraphQL schemas [started]
[20:46:04.322] [18:46:04] Load GraphQL schemas [started]
[20:46:04.322] [18:46:04] Load GraphQL schemas [started]
[20:46:04.919] [18:46:04] Load GraphQL schemas [completed]
[20:46:04.920] [18:46:04] Load GraphQL documents [started]
[20:46:04.920] [18:46:04] Load GraphQL documents [completed]
[20:46:04.920] [18:46:04] Generate [started]
[20:46:04.951] [18:46:04] Generate [completed]
[20:46:04.951] [18:46:04] Generate ./src/graphql/fragmentTypes.generated.ts [completed]
[20:46:05.358] [18:46:05] Load GraphQL schemas [completed]
[20:46:05.359] [18:46:05] Load GraphQL documents [started]
[20:46:05.731] [18:46:05] Load GraphQL schemas [completed]
[20:46:05.732] [18:46:05] Load GraphQL documents [started]
[20:46:05.732] [18:46:05] Load GraphQL documents [completed]
[20:46:05.732] [18:46:05] Generate [started]
[20:46:05.799] [18:46:05] Generate [completed]
[20:46:05.800] [18:46:05] Generate ./src/graphql/typePolicies.generated.ts [completed]
[20:46:06.118] [18:46:06] Load GraphQL schemas [completed]
[20:46:06.118] [18:46:06] Load GraphQL documents [started]
[20:46:06.839] [18:46:06] Load GraphQL documents [completed]
[20:46:06.839] [18:46:06] Generate [started]
[20:46:15.700] [18:46:15] Generate [completed]
[20:46:15.702] [18:46:15] Generate ./src/graphql/types.generated.ts [completed]
[20:46:15.809] [18:46:15] Load GraphQL documents [completed]
[20:46:15.810] [18:46:15] Generate [started]
[20:46:23.846] [18:46:23] Generate [completed]
[20:46:23.846] [18:46:23] Generate to ./src/graphql/hooks.generated.ts (using EXPERIMENTAL preset "import-types") [completed]
[20:46:23.846] [18:46:23] Generate outputs [completed]
[20:46:23.890] 
[20:46:23.890] > saleor-dashboard@3.12.1 build
[20:46:23.890] > cross-env NODE_OPTIONS=--max_old_space_size=16384 vite build
[20:46:23.890] 
[20:46:24.406] [log] Enabling service worker...
[20:46:24.508] [log] vite v3.2.4 building for production...
[20:46:24.578] [log] transforming...
[20:47:14.629] [log] ✓ 9861 modules transformed.
[20:47:33.344] Error: Command "npm run build" exited with 1
[20:47:34.010] BUILD_FAILED: Command "npm run build" exited with 1

System information

Dashboard version:

v3.12.1

valiukasd commented 1 year ago

Update: Same issue occurs when deploying to netlify

amityweb commented 1 year ago

Same here too - have you managed to find a fix? I tried with 3.12 branch, but then think the stable release was 3.11 from their releases page, but both have the same error. It actually builds fine on my local machine.

17:46:55.046 | Error: Command "npm run build" exited with 1
17:46:55.164 | BUILD_UTILS_SPAWN_1: Command "npm run build" exited with 1
amityweb commented 1 year ago

As per this discussion, https://github.com/saleor/saleor-dashboard/discussions/3188

Adding Environment variable to Vercel SKIP_SOURCEMAPS = true works for me.

vasc1 commented 1 year ago

you are right @amityweb the problem is inside vite.config.js

However, all compilation files are being generated in "build/dashboard" and the vercel platform at deploy time is accusing that there is no "dist" folder, so if it still doesn't work even changing SKIP_SOURCEMPS to "true" value, change all "build/dashboard" files declarations to "dist" or do the opposite, set to look for "build/dashboard" :)

stale[bot] commented 1 year ago

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.