Description
Issue type (mark with x
)
- π€ Question
- π Bug report
- π Feature request
- π€·ββοΈ Other
Description
When I try to use some libraries which has files with .cjs
-extension as a NodeJS dependecy. For example, @reduxjs/toolkit
.
Liferay throws the error in runtime
Missing dependency
@testapp$reduxjs/[email protected]/dist/cjs/redux-toolkit.development.cjs
of@testapp$reduxjs/[email protected]/dist/cjs/index
and
Uncaught (in promise) Error: Unsatisfied dependency:
./redux-toolkit.development.cjs
found in module@testapp$reduxjs/[email protected]/dist/cjs/index

An example of my code in testapp
import { configureStore, combineReducers } from '@reduxjs/toolkit'
const rootReducer = combineReducers({
...
});
const store = configureStore({
reducer: rootReducer,
});
...
I've tested another libraries. For example, MobX
. It has the same problem when find .cjs
file.
Other information (environment, versions etc):
I verified this problem with:
Liferay 7.3 GA5
liferay-npm-bundler: 2.31.2
@reduxjs/toolkit 2.2.0
NodeJS 16.16.0
NPM 6.14.4
Other versions of NodeJS and npm have the problem also.