goetzrobin / spartan

Cutting-edge tools powering Angular full-stack development.
https://spartan.ng
MIT License
1.31k stars 138 forks source link

Failed build on every other env #364

Open d4vss opened 3 weeks ago

d4vss commented 3 weeks ago

Please provide the environment you discovered this bug in.

Which area/package is the issue in?

Don't know / other

Description

Update: Building on other env than mine gives error for every single imported component. Local build works without issues.

Please provide the exception or error you saw

[22:32:38.699] Running build in Washington, D.C., USA (East) – iad1
[22:32:38.856] Skipping build cache, deployment was triggered without cache.
[22:32:39.230] Cloning completed: 381.485ms
[22:32:39.542] Running "vercel build"
[22:32:39.989] Vercel CLI 37.1.1
[22:32:40.626] Running "install" command: `npm install`...
[22:32:46.251] npm warn deprecated rimraf@3.0.2: Rimraf versions prior to v4 are no longer supported
[22:32:47.856] npm warn deprecated inflight@1.0.6: This module is not supported, and leaks memory. Do not use it. Check out lru-cache if you want a good and tested way to coalesce async requests by a key value, which is much more comprehensive and powerful.
[22:32:48.170] npm warn deprecated glob@7.2.3: Glob versions prior to v9 are no longer supported
[22:32:51.035] npm warn deprecated @humanwhocodes/object-schema@2.0.3: Use @eslint/object-schema instead
[22:32:51.036] npm warn deprecated @humanwhocodes/config-array@0.11.14: Use @eslint/config-array instead
[22:33:00.323] 
[22:33:00.325] added 1555 packages, and audited 1556 packages in 20s
[22:33:00.325] 
[22:33:00.325] 206 packages are looking for funding
[22:33:00.325]   run `npm fund` for details
[22:33:00.327] 
[22:33:00.327] 1 moderate severity vulnerability
[22:33:00.327] 
[22:33:00.327] To address all issues, run:
[22:33:00.327]   npm audit fix
[22:33:00.327] 
[22:33:00.327] Run `npm audit` for details.
[22:33:01.951] ❯ Building...
[22:33:17.664] ✔ Building...
[22:33:17.667] Prerendered 0 static routes.
[22:33:17.667] Application bundle generation failed. [15.713 seconds]
[22:33:17.667] 
[22:33:17.668] ✘ [ERROR] Could not resolve "@spartan-ng/ui-button-helm"
[22:33:17.670] 
[22:33:17.670]     components/layout/footer/footer.component.ts:2:35:
[22:33:17.670]       2 │ import { HlmButtonDirective } from '@spartan-ng/ui-button-helm';
[22:33:17.670]         ╵                                    ~~~~~~~~~~~~~~~~~~~~~~~~~~~~
[22:33:17.670] 
[22:33:17.670]   You can mark the path "@spartan-ng/ui-button-helm" as external to exclude it from the bundle, which will remove this error and leave the unresolved path in the bundle.
[22:33:17.671] 
[22:33:17.671] 
[22:33:17.671] ✘ [ERROR] Could not resolve "@spartan-ng/ui-button-helm"
[22:33:17.671] 
[22:33:17.671]     components/layout/header/header.component.ts:2:35:
[22:33:17.671]       2 │ import { HlmButtonDirective } from '@spartan-ng/ui-button-helm';
[22:33:17.671]         ╵                                    ~~~~~~~~~~~~~~~~~~~~~~~~~~~~
[22:33:17.671] 
[22:33:17.671]   You can mark the path "@spartan-ng/ui-button-helm" as external to exclude it from the bundle, which will remove this error and leave the unresolved path in the bundle.
[22:33:17.672] 
[22:33:17.672] 
[22:33:17.672] ✘ [ERROR] Could not resolve "@spartan-ng/ui-sheet-helm"
[22:33:17.672] 
[22:33:17.672]     components/layout/header/header.component.ts:4:164:
[22:33:17.672]       4 │ ...mponent, HlmSheetTitleDirective } from '@spartan-ng/ui-sheet-helm';
[22:33:17.672]         ╵                                           ~~~~~~~~~~~~~~~~~~~~~~~~~~~
[22:33:17.672] 
[22:33:17.672]   You can mark the path "@spartan-ng/ui-sheet-helm" as external to exclude it from the bundle, which will remove this error and leave the unresolved path in the bundle.
[22:33:17.672] 
[22:33:17.673] 
[22:33:17.673] ✘ [ERROR] Could not resolve "@spartan-ng/ui-button-helm"
[22:33:17.673] 
[22:33:17.673]     pages/home/home.component.ts:3:35:
[22:33:17.673]       3 │ import { HlmButtonDirective } from '@spartan-ng/ui-button-helm';
[22:33:17.673]         ╵                                    ~~~~~~~~~~~~~~~~~~~~~~~~~~~~
[22:33:17.673] 
[22:33:17.673]   You can mark the path "@spartan-ng/ui-button-helm" as external to exclude it from the bundle, which will remove this error and leave the unresolved path in the bundle.
[22:33:17.673] 
[22:33:17.673] 
[22:33:17.673] ✘ [ERROR] Could not resolve "@spartan-ng/ui-button-helm"
[22:33:17.674] 
[22:33:17.674]     components/layout/footer/footer.component.ts:2:35:
[22:33:17.674]       2 │ import { HlmButtonDirective } from '@spartan-ng/ui-button-helm';
[22:33:17.674]         ╵                                    ~~~~~~~~~~~~~~~~~~~~~~~~~~~~
[22:33:17.674] 
[22:33:17.674]   You can mark the path "@spartan-ng/ui-button-helm" as external to exclude it from the bundle, which will remove this error and leave the unresolved path in the bundle.
[22:33:17.674] 
[22:33:17.674] 
[22:33:17.674] ✘ [ERROR] Could not resolve "@spartan-ng/ui-button-helm"
[22:33:17.674] 
[22:33:17.674]     components/layout/header/header.component.ts:2:35:
[22:33:17.675]       2 │ import { HlmButtonDirective } from '@spartan-ng/ui-button-helm';
[22:33:17.675]         ╵                                    ~~~~~~~~~~~~~~~~~~~~~~~~~~~~
[22:33:17.675] 
[22:33:17.675]   You can mark the path "@spartan-ng/ui-button-helm" as external to exclude it from the bundle, which will remove this error and leave the unresolved path in the bundle.
[22:33:17.675] 
[22:33:17.675] 
[22:33:17.675] ✘ [ERROR] Could not resolve "@spartan-ng/ui-sheet-helm"
[22:33:17.675] 
[22:33:17.675]     components/layout/header/header.component.ts:4:164:
[22:33:17.675]       4 │ ...mponent, HlmSheetTitleDirective } from '@spartan-ng/ui-sheet-helm';
[22:33:17.675]         ╵                                           ~~~~~~~~~~~~~~~~~~~~~~~~~~~
[22:33:17.676] 
[22:33:17.676]   You can mark the path "@spartan-ng/ui-sheet-helm" as external to exclude it from the bundle, which will remove this error and leave the unresolved path in the bundle.
[22:33:17.676] 
[22:33:17.676] 
[22:33:17.676] ✘ [ERROR] Could not resolve "@spartan-ng/ui-button-helm"
[22:33:17.676] 
[22:33:17.676]     pages/home/home.component.ts:3:35:
[22:33:17.676]       3 │ import { HlmButtonDirective } from '@spartan-ng/ui-button-helm';
[22:33:17.676]         ╵                                    ~~~~~~~~~~~~~~~~~~~~~~~~~~~~
[22:33:17.677] 
[22:33:17.677]   You can mark the path "@spartan-ng/ui-button-helm" as external to exclude it from the bundle, which will remove this error and leave the unresolved path in the bundle.
[22:33:17.677] 
[22:33:17.677] 
[22:33:17.765] Error: Command "ng build" exited with 1
[22:33:18.164]

Other information

No response

I would be willing to submit a PR to fix this issue

ajitzero commented 3 weeks ago

Please check your Vercel/env settings for the Node version & pnpm version. They should match these:

https://github.com/goetzrobin/spartan/blob/46d538afcb3a2186cef2ad45f5dafc470e592113/package.json#L6-L13

I've faced a similar issue with Netlify using a different pnpm version and fixed it by changing build settings.

goetzrobin commented 2 weeks ago

@d4vss is this open source? Seems like there might also be something funky going on with ts-paths

d4vss commented 2 weeks ago

@d4vss is this open source? Seems like there might also be something funky going on with ts-paths

It's not, but it can be recreated by for e.g. creating a new Angular Project (Latest), pushing repository to GitHub and building project inside Vercel/Netlify or a Node Docker Container.