Skip to content

Commit 965fb34

Browse files
authored
chore: fix build errors (#5206)
1 parent 95ff4cd commit 965fb34

File tree

3 files changed

+21
-24
lines changed

3 files changed

+21
-24
lines changed

.circleci/config.yml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -118,6 +118,8 @@ jobs:
118118
- run:
119119
name: Build Extension
120120
command: pnpm --filter extension build
121+
environment:
122+
NODE_OPTIONS: --max-old-space-size=8192
121123
workflows:
122124
build:
123125
jobs:

packages/shared/src/components/modals/common.tsx

Lines changed: 11 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -328,24 +328,17 @@ const SquadNotificationSettingsModal = dynamic(
328328
),
329329
);
330330

331-
// Opportunity modals are webapp-only and import lib/schema/opportunity.ts
332-
// which triggers Next.js 15.4.10 Babel bug ("Invalid array length") in extension builds
333-
// Must use process.env directly (not isExtension) for webpack compile-time exclusion
334-
const OpportunityEditModal = process.env.TARGET_BROWSER
335-
? null
336-
: dynamic(() =>
337-
import(
338-
/* webpackChunkName: "opportunityEditModal" */ '../opportunity/OpportunityEditModal/OpportunityEditModal'
339-
).then((mod) => mod.OpportunityEditModal),
340-
);
341-
342-
const OpportunityEditRecruiterModal = process.env.TARGET_BROWSER
343-
? null
344-
: dynamic(() =>
345-
import(
346-
/* webpackChunkName: "opportunityEditRecruiterModal" */ '../opportunity/OpportunityEditModal/OpportunityEditRecruiterModal'
347-
).then((mod) => mod.OpportunityEditRecruiterModal),
348-
);
331+
const OpportunityEditModal = dynamic(() =>
332+
import(
333+
/* webpackChunkName: "opportunityEditModal" */ '../opportunity/OpportunityEditModal/OpportunityEditModal'
334+
).then((mod) => mod.OpportunityEditModal),
335+
);
336+
337+
const OpportunityEditRecruiterModal = dynamic(() =>
338+
import(
339+
/* webpackChunkName: "opportunityEditRecruiterModal" */ '../opportunity/OpportunityEditModal/OpportunityEditRecruiterModal'
340+
).then((mod) => mod.OpportunityEditRecruiterModal),
341+
);
349342

350343
const DirtyFormModal = dynamic(
351344
() => import(/* webpackChunkName: "dirtyFormModal" */ './DirtyFormModal'),

packages/shared/src/lib/schema/opportunity.ts

Lines changed: 8 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,9 @@
11
import z from 'zod';
2-
import { SalaryPeriod } from '../../features/opportunity/protobuf/opportunity';
3-
import { isNullOrUndefined } from '../func';
42
import { labels } from '../labels';
3+
import { isNullOrUndefined } from '../func';
4+
5+
const MAX_SALARY = 100_000_000;
6+
const MAX_TEAM_SIZE = 1_000_000;
57

68
const processSalaryValue = (val: unknown) => {
79
if (Number.isNaN(val) || isNullOrUndefined(val)) {
@@ -31,22 +33,22 @@ export const opportunityEditInfoSchema = z.object({
3133
.int()
3234
.nonnegative()
3335
.min(1, 'Enter the team size')
34-
.max(1_000_000),
36+
.max(MAX_TEAM_SIZE),
3537
salary: z
3638
.object({
3739
min: z.preprocess(
3840
processSalaryValue,
39-
z.number().int().nonnegative().max(100_000_000).optional(),
41+
z.number().int().nonnegative().max(MAX_SALARY).optional(),
4042
),
4143
max: z.preprocess(
4244
processSalaryValue,
43-
z.number().int().nonnegative().max(100_000_000).optional(),
45+
z.number().int().nonnegative().max(MAX_SALARY).optional(),
4446
),
4547
period: z
4648
.number()
4749
.nullish()
4850
.transform((val) => val ?? undefined)
49-
.default(SalaryPeriod.UNSPECIFIED),
51+
.default(0),
5052
})
5153
.nullish()
5254
.refine(

0 commit comments

Comments
 (0)