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

Failed to resolve entry for package "diff". The package may have incorrect main/module/exports #501

Closed
ericrange opened this issue Mar 12, 2024 · 3 comments

Comments

@ericrange
Copy link

with the latest vite, there is the following error. is there an official es6 way to import this lib?

3:28:17 PM [vite] Internal server error: Failed to resolve entry for package "diff". The package may have incorrect main/module/exports specified in its package.json.
  Plugin: vite:import-analysis
  File: /home/Repositories/vue/src/workers/audit-delta-worker.js?worker_file&type=module
@chardin1
Copy link

chardin1 commented Mar 14, 2024

I'm having this same issue in Node as well:

const Diff = require('diff');
Error: Cannot find module 'diff'

Nevermind. I accidentally ran npm install jsdiff instead of npm install diff

@ExplodingCabbage
Copy link
Collaborator

@ericrange can you give me some minimal instructions on how to reproduce the error you're seeing? Happy to try to figure out a fix, but my knowledge of JavaScript module systems is limited and I'd never heard of vite prior to reading this issue.

@ExplodingCabbage
Copy link
Collaborator

Closing pending instructions on how to repro the error.

@ExplodingCabbage ExplodingCabbage closed this as not planned Won't fix, can't repro, duplicate, stale Apr 29, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants