Windows path issue in treeForIntlTelInput causes duplicated build/js path

Open Beginner friendly
#128 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Assessment

Difficulty
2/5
Estimated time
1-3 hours
Newbie friendliness
78/100
Issue type
Bug
Clarity
Clearly specified
Activity status
Quiet
Tech stack
javascript, node.js
Domain
build-system

Research direction

Search the codebase for treeForIntlTelInput and inspect how require.resolve('intl-tel-input') is converted into the package path. Reproduce the extension build on Windows or verify the path handling against Windows separators, then confirm the generated path contains build/js only once and the build succeeds.

Written by the indexing model from the issue text.

Description

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

Dominant language
JavaScript
Stars
11
Forks
25
Avg merge
1d 20h
Merged PRs (30d)
28

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

More from fleetbase/ember-ui

All issues in fleetbase/ember-ui

Similar issues

More JavaScript issues

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.