Skip to content

Commit cea2664

Browse files
fix: issue with loading typescript and v8 snapshot (#24684)
1 parent 9b1d05d commit cea2664

File tree

2 files changed

+13
-6
lines changed

2 files changed

+13
-6
lines changed

.circleci/config.yml

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@ mainBuildFilters: &mainBuildFilters
2727
branches:
2828
only:
2929
- develop
30-
- 'ryanm/fix/migrating-to-11-from-9-typescript'
30+
- 'ryanm/fix/typescript-issue'
3131

3232
# usually we don't build Mac app - it takes a long time
3333
# but sometimes we want to really confirm we are doing the right thing
@@ -36,7 +36,7 @@ macWorkflowFilters: &darwin-workflow-filters
3636
when:
3737
or:
3838
- equal: [ develop, << pipeline.git.branch >> ]
39-
- equal: [ 'ryanm/fix/migrating-to-11-from-9-typescript', << pipeline.git.branch >> ]
39+
- equal: [ 'ryanm/fix/typescript-issue', << pipeline.git.branch >> ]
4040
- matches:
4141
pattern: "-release$"
4242
value: << pipeline.git.branch >>
@@ -45,7 +45,7 @@ linuxArm64WorkflowFilters: &linux-arm64-workflow-filters
4545
when:
4646
or:
4747
- equal: [ develop, << pipeline.git.branch >> ]
48-
- equal: [ 'ryanm/fix/migrating-to-11-from-9-typescript', << pipeline.git.branch >> ]
48+
- equal: [ 'ryanm/fix/typescript-issue', << pipeline.git.branch >> ]
4949
- matches:
5050
pattern: "-release$"
5151
value: << pipeline.git.branch >>
@@ -63,7 +63,7 @@ windowsWorkflowFilters: &windows-workflow-filters
6363
when:
6464
or:
6565
- equal: [ develop, << pipeline.git.branch >> ]
66-
- equal: [ 'ryanm/fix/migrating-to-11-from-9-typescript', << pipeline.git.branch >> ]
66+
- equal: [ 'ryanm/fix/typescript-issue', << pipeline.git.branch >> ]
6767
- matches:
6868
pattern: "-release$"
6969
value: << pipeline.git.branch >>
@@ -130,7 +130,7 @@ commands:
130130
- run:
131131
name: Check current branch to persist artifacts
132132
command: |
133-
if [[ "$CIRCLE_BRANCH" != "develop" && "$CIRCLE_BRANCH" != "ryanm/fix/migrating-to-11-from-9-typescript" ]]; then
133+
if [[ "$CIRCLE_BRANCH" != "develop" && "$CIRCLE_BRANCH" != "ryanm/fix/typescript-issue" ]]; then
134134
echo "Not uploading artifacts or posting install comment for this branch."
135135
circleci-agent step halt
136136
fi

packages/packherd-require/src/loader.ts

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -898,8 +898,15 @@ export class PackherdModuleLoader {
898898
parent = this._createModule(fullPath, parent, moduleUri)
899899
}
900900

901+
const originalRequireResolve = require.resolve
902+
901903
require.resolve = Object.assign(
902-
(moduleUri: string, _options?: { paths?: string[] }) => {
904+
(moduleUri: string, options?: { paths?: string[] }) => {
905+
// Handle the case where options populated. The module is expected to be outside of the cypress snapshot so use the original require.resolve.
906+
if (options && options.paths) {
907+
return originalRequireResolve(moduleUri, options)
908+
}
909+
903910
return this.tryResolve(moduleUri, parent).fullPath
904911
},
905912
{

0 commit comments

Comments
 (0)