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

Cannot find module 'entities/dist/decode.js' from 'node_modules/@vue/compiler-core/dist/compiler-core.cjs.js' #11603

Closed
yashjainyj opened this issue Aug 13, 2024 · 5 comments

Comments

@yashjainyj
Copy link

yashjainyj commented Aug 13, 2024

Vue version

3.4.37

Link to minimal reproduction

https://github.com/yashjainyj/vue_Module_Issue

Steps to reproduce

clone my repo
and run below command
yarn run test:unit

What is expected?

all jest test case should be resolved and run successfully

What is actually happening?

My Jest unit tests are failing

It appears that the vue package relies on an external dependency called entities. In the entities package, the decode.js file is missing from the dist folder.

However, the entities package has been updated and now contains two sub-folders, commonjs and esm, within the dist folder,

where decode.js can be found. The https://github.com/VUE package has not yet updated its path to reflect these changes.

System Info

No response

Any additional comments?

No response

@yyx990803
Copy link
Member

yyx990803 commented Aug 13, 2024

It was updated in ea190f2 and the paths are updated accordingly. The file also can be correctly resolved from dist/compiler-core.cjs.js when required from plain Node.js. It seems this is an issue with Jest's resolver rather than a Vue issue.

@yashjainyj
Copy link
Author

yashjainyj commented Aug 13, 2024

Thanks for your response.

Since I didn't declare the entities in package.json, and Vue is internally using vue/compiler-core which relies on entities, I'm unable to update the path for these dependencies.

As a temporary fix, I've set the Vue version to 3.4.27 without the caret (^) to prevent automatic updates.

I'm looking for a permanent solution to this issue.

Thank you.

@p3k
Copy link

p3k commented Aug 14, 2024

I have the same issue not using Jest but Mocha.

@yashjainyj
Copy link
Author

yashjainyj commented Aug 14, 2024

I have the same issue not using Jest but Mocha.

Did you try the below solution
As a temporary fix, set the Vue version to 3.4.27 without the caret (^) to prevent automatic updates.

@p3k
Copy link

p3k commented Aug 14, 2024

No, did not try this but I am sure it works – I am getting the error in a MR for a dependency upgrade, the error is not in our production branch.

@github-actions github-actions bot locked and limited conversation to collaborators Aug 30, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants