@@ -102,7 +102,7 @@ let attachCompilerAndLibraries = (~version: string, ~libraries: array<string>, (
102
102
/* let compilerUrl = "/static/linked-bs-bundle.js"; */
103
103
104
104
LoadScript .loadScriptPromise (compilerUrl )
105
- -> Promise .map (r => {
105
+ -> Promise .thenResolve (r => {
106
106
switch r {
107
107
| Error (_ ) => Error (j ` Could not load compiler from url $compilerUrl` )
108
108
| _ => r
@@ -113,7 +113,7 @@ let attachCompilerAndLibraries = (~version: string, ~libraries: array<string>, (
113
113
| Ok () =>
114
114
Belt .Array .map (libraries , lib => {
115
115
let cmijUrl = CdnMeta .getLibraryCmijUrl (version , lib )
116
- LoadScript .loadScriptPromise (cmijUrl )-> Promise .map (r =>
116
+ LoadScript .loadScriptPromise (cmijUrl )-> Promise .thenResolve (r =>
117
117
switch r {
118
118
| Error (_ ) => Error (j ` Could not load cmij from url $cmijUrl` )
119
119
| _ => r
@@ -125,7 +125,7 @@ let attachCompilerAndLibraries = (~version: string, ~libraries: array<string>, (
125
125
126
126
Promise .all (promises )
127
127
})
128
- -> Promise .map (all => {
128
+ -> Promise .thenResolve (all => {
129
129
let errors = Belt .Array .keepMap (all , r => {
130
130
switch r {
131
131
| Error (msg ) => Some (msg )
@@ -333,7 +333,7 @@ let useCompilerManager = (~initialLang: Lang.t=Res, ~onAction: option<action =>
333
333
let libraries = ["@rescript/react" ]
334
334
335
335
attachCompilerAndLibraries (~version = latest , ~libraries , ())
336
- -> Promise .map (result =>
336
+ -> Promise .thenResolve (result =>
337
337
switch result {
338
338
| Ok () =>
339
339
let instance = Compiler .make ()
@@ -375,7 +375,7 @@ let useCompilerManager = (~initialLang: Lang.t=Res, ~onAction: option<action =>
375
375
let migratedLibraries = libraries -> migrateLibraries (~version )
376
376
377
377
attachCompilerAndLibraries (~version , ~libraries = migratedLibraries , ())
378
- -> Promise .map (result =>
378
+ -> Promise .thenResolve (result =>
379
379
switch result {
380
380
| Ok () =>
381
381
// Make sure to remove the previous script from the DOM as well
0 commit comments