Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Unsatisfied dependency: *.cjs found in module #1202

Open
2 of 4 tasks
itryapitsin2 opened this issue Apr 14, 2024 · 1 comment
Open
2 of 4 tasks

Unsatisfied dependency: *.cjs found in module #1202

itryapitsin2 opened this issue Apr 14, 2024 · 1 comment

Comments

@itryapitsin2
Copy link

itryapitsin2 commented Apr 14, 2024

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

image

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.

@bryceosterhaus
Copy link
Member

Hey, thanks for opening this. Just FYI, dince this code is community-maintained, things can go slower than expected because there is no SLA in place. If you have a support contract for any of the Liferay products use the official channels to report your issue.
In any case, if you decide to file the issue here, remember that all information you can gather about the issue and the reason why it is happening will help a lot in its resolution because otherwise it involves a lot of effort just to find out if it is a bug or what can be causing it.

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

No branches or pull requests

2 participants