Skip to content

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

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

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions