Skip to content

npm start fails on a fresh clone: @translations/i18next cannot be resolved by webpack #308

Description

@preetham1930

Package version (if known): master (v3.2.0)

Describe the bug

npm start fails to compile on a fresh clone. Ten components that import
@translations/i18next fail with:

Module not found: Error: Can't resolve '@translations/i18next'

Affected: AutocompleteSearchBar, EmptyResults, Error, RangeCustomFilter,
RangeFacet, ResultsPerPage, SearchBar, SortBy, SortOrder, Sort.

The @translations/i18next alias is defined for Jest (jest.moduleNameMapper
in package.json) and for the library build (@rollup/plugin-alias in
rollup.config.js), but nothing provides it to webpack, which is what
react-scripts start uses. So tests and npm run build pass while only the
demo dev server is broken, which may be why this hasn't surfaced.

I confirmed the cause by adding a local shim in node_modules mapping the alias
to src/lib/i18next. After that npm start compiles and the demos render.

Steps to Reproduce

  1. git clone https://github.com/inveniosoftware/react-searchkit.git
  2. npm install
  3. npm start

Expected behavior

npm start compiles and serves the demo apps.

Additional context

Node 24.11.1, Windows 11.

CRA doesn't allow custom webpack aliases without ejecting, so the fix likely
needs a maintainer decision (relative import in the demos, or a
jsconfig/craco setup). Happy to open a PR once there's a preferred direction.

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

    bugSomething isn't working

    Type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions