File tree Expand file tree Collapse file tree 1 file changed +9
-0
lines changed
Expand file tree Collapse file tree 1 file changed +9
-0
lines changed Original file line number Diff line number Diff line change @@ -82,6 +82,10 @@ export const loadModules = (modulesList) => Promise.all(modulesList.map(({ id, u
8282 * @param {* } url
8383 */
8484export const loadModule = ( id : string , url : string ) => {
85+ if ( typeof window !== 'object' ) {
86+ return Promise . reject ( new Error ( 'Load module is working only on browser env' ) ) ;
87+ }
88+
8589 if ( ! id ) {
8690 throw new Error ( 'Module id is required' )
8791 }
@@ -147,6 +151,11 @@ export const loadModule = (id: string, url: string) => {
147151 * @param {any } metadata - additional module metadata like version
148152 */
149153export const registerModule = ( id : string , instance : any , metadata ?: any ) => {
154+ // loader not working on nodejs envs
155+ if ( typeof window !== 'object' ) {
156+ return ;
157+ }
158+
150159 if ( ! id ) {
151160 throw new Error ( 'Module id is required' )
152161 }
You can’t perform that action at this time.
0 commit comments