Skip to content

Commit 8be88a3

Browse files
fix: TextEditor async import (WH-1097) (#251)
1 parent 07c8282 commit 8be88a3

File tree

3 files changed

+15
-10
lines changed

3 files changed

+15
-10
lines changed

lib/components/TextEditor/components/TextEditorFull/TextEditorFull.tsx

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,12 @@ const AceEditor = lazy(() =>
4646
import('ace-builds/src-noconflict/ext-searchbox')
4747
])
4848

49-
return module
49+
// vite bug: when the components installed as module, vite wraps async import in additional object, but for `yarn link` it doesn't
50+
return (
51+
typeof module.default !== 'function' // if it's a module
52+
? module.default
53+
: module
54+
) as typeof module
5055
})
5156
)
5257

package.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,7 @@
4444
"clsx": "^2.0.0",
4545
"copy-to-clipboard": "^3.3.3",
4646
"luxon": "^3.4.4",
47-
"react-ace": "^13.0.0",
47+
"react-ace": "^14.0.1",
4848
"react-hook-form": "^7.53.2",
4949
"react-router-dom": "^6.25.0",
5050
"react-select": "^5.8.0",
@@ -114,5 +114,5 @@
114114
"vite": "^6.1.0",
115115
"vite-plugin-svgr": "^4.2.0"
116116
},
117-
"packageManager": "yarn@4.6.0+sha512.5383cc12567a95f1d668fbe762dfe0075c595b4bfff433be478dbbe24e05251a8e8c3eb992a986667c1d53b6c3a9c85b8398c35a960587fbd9fa3a0915406728"
117+
"packageManager": "yarn@4.6.0"
118118
}

yarn.lock

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -4951,7 +4951,7 @@ __metadata:
49514951
luxon: "npm:^3.4.4"
49524952
prettier: "npm:^2.8.4"
49534953
react: "npm:^18.2.0"
4954-
react-ace: "npm:^13.0.0"
4954+
react-ace: "npm:^14.0.1"
49554955
react-dom: "npm:^18.2.0"
49564956
react-hook-form: "npm:^7.53.2"
49574957
react-router-dom: "npm:^6.25.0"
@@ -10088,19 +10088,19 @@ __metadata:
1008810088
languageName: node
1008910089
linkType: hard
1009010090

10091-
"react-ace@npm:^13.0.0":
10092-
version: 13.0.0
10093-
resolution: "react-ace@npm:13.0.0"
10091+
"react-ace@npm:^14.0.1":
10092+
version: 14.0.1
10093+
resolution: "react-ace@npm:14.0.1"
1009410094
dependencies:
1009510095
ace-builds: "npm:^1.36.3"
1009610096
diff-match-patch: "npm:^1.0.5"
1009710097
lodash.get: "npm:^4.4.2"
1009810098
lodash.isequal: "npm:^4.5.0"
1009910099
prop-types: "npm:^15.8.1"
1010010100
peerDependencies:
10101-
react: ^0.13.0 || ^0.14.0 || ^15.0.1 || ^16.0.0 || ^17.0.0 || ^18.0.0
10102-
react-dom: ^0.13.0 || ^0.14.0 || ^15.0.1 || ^16.0.0 || ^17.0.0 || ^18.0.0
10103-
checksum: 10c0/adbe485de187b69ca493bc986b587bf76222cf7eedfba53afd33deba7310cf094baf0fe8c42b4833e1fb7e26144d916797fe482137d563d15d91314d5292d8cc
10101+
react: ^0.13.0 || ^0.14.0 || ^15.0.1 || ^16.0.0 || ^17.0.0 || ^18.0.0 || ^19.0.0
10102+
react-dom: ^0.13.0 || ^0.14.0 || ^15.0.1 || ^16.0.0 || ^17.0.0 || ^18.0.0 || ^19.0.0
10103+
checksum: 10c0/dbc77970836f13bad88365903d077edd68cc1955857290475bc067e0b801181c1d60a9ee08cf89b20895fe312dbb169c072c5b23338d7176f9f658db7929732f
1010410104
languageName: node
1010510105
linkType: hard
1010610106

0 commit comments

Comments
 (0)