Skip to content

Windows path issue in treeForIntlTelInput causes duplicated build/js path #128

@623828105

Description

@623828105

When running Fleetbase Console on Windows, the Extension Build System fails with:

Directory not found:
node_modules\intl-tel-input\build\js\build\js

The issue appears to come from this code:

const intlTelInputPath = path
.dirname(require.resolve('intl-tel-input'))
.replace(/build/js$/, '');

On Windows, require.resolve() returns paths using backslashes:

...\intl-tel-input\build\js

So the regex /build/js$/ does not match, causing the path to become:

...\build\js\build\js

Suggested fix:

.replace(/[\/]build[\/]js$/, '')

Or more robust:

const intlTelInputPath = path.resolve(
path.dirname(require.resolve('intl-tel-input')),
'../..'
);

Environment:

Windows 11
Node 20.19.x
Yarn 1.22.x
Fleetbase Console 0.7.38

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions