Skip to content

Commit c991aa3

Browse files
committed
fix: update import path for icon packages to use pathToFileURL
1 parent 7a03860 commit c991aa3

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

adminforth/modules/codeInjector.ts

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,7 @@ import { ADMIN_FORTH_ABSOLUTE_PATH, getComponentNameFromPath, transformObject, d
1111
import { ICodeInjector } from '../types/Back.js';
1212
import { StylesGenerator } from './styleGenerator.js';
1313
import { afLogger } from '../modules/logger.js';
14+
import { pathToFileURL } from 'url';
1415

1516

1617
let TMP_DIR;
@@ -98,7 +99,7 @@ class CodeInjector implements ICodeInjector {
9899
console.log('iconPackageNames', iconPackageNames);
99100

100101
const iconPackages = (
101-
await Promise.allSettled(iconPackageNames.map(async (pkg) => ({ pkg: await import(path.join(this.spaTmpPath(), 'node_modules', pkg)), name: pkg})))
102+
await Promise.allSettled(iconPackageNames.map(async (pkg) => ({ pkg: await import(pathToFileURL(path.join(this.spaTmpPath(), 'node_modules', pkg)).href), name: pkg})))
102103
);
103104

104105
console.log('iconPackages', iconPackages);

0 commit comments

Comments
 (0)