mozilla / pdf.js

PDF Reader in JavaScript
https://mozilla.github.io/pdf.js/
Apache License 2.0
48.63k stars 10k forks source link

No matching export in "node_modules/y18n/build/lib/index.js" for import "default" #16002

Closed BloodlustLR closed 1 year ago

BloodlustLR commented 1 year ago

I use electron+vite+vue3 to build my app, but when I run script "npm run dev",it gives me the following problem.

`X [ERROR] No matching export in "node_modules/y18n/build/lib/index.js" for import "default"

node_modules/yargs/lib/platform-shims/esm.mjs:13:7:
  13 │ import y18n from 'y18n'
     ╵        ~~~~

D:\WorkSpace\VSCode\signature\v1\client\node_modules\vite\node_modules\esbuild\lib\main.js:1604 let error = new Error(${text}${summary}); ^

Error: Build failed with 1 error: node_modules/yargs/lib/platform-shims/esm.mjs:13:7: ERROR: No matching export in "node_modules/y18n/build/lib/index.js" for import "default" at failureErrorWithLog (D:\WorkSpace\VSCode\signature\v1\client\node_modules\vite\node_modules\esbuild\lib\main.js:1604:15) at D:\WorkSpace\VSCode\signature\v1\client\node_modules\vite\node_modules\esbuild\lib\main.js:1056:28 at runOnEndCallbacks (D:\WorkSpace\VSCode\signature\v1\client\node_modules\vite\node_modules\esbuild\lib\main.js:1476:61) at buildResponseToResult (D:\WorkSpace\VSCode\signature\v1\client\node_modules\vite\node_modules\esbuild\lib\main.js:1054:7) at D:\WorkSpace\VSCode\signature\v1\client\node_modules\vite\node_modules\esbuild\lib\main.js:1166:14 at responseCallbacks. (D:\WorkSpace\VSCode\signature\v1\client\node_modules\vite\node_modules\esbuild\lib\main.js:701:9) at handleIncomingPacket (D:\WorkSpace\VSCode\signature\v1\client\node_modules\vite\node_modules\esbuild\lib\main.js:756:9) at Socket.readFromStdout (D:\WorkSpace\VSCode\signature\v1\client\node_modules\vite\node_modules\esbuild\lib\main.js:677:7) at Socket.emit (node:events:513:28) at addChunk (node:internal/streams/readable:315:12) { errors: [ { detail: undefined, id: '', location: { column: 7, file: 'node_modules/yargs/lib/platform-shims/esm.mjs', length: 4, line: 13, lineText: "import y18n from 'y18n'", namespace: '', suggestion: '' }, notes: [], pluginName: '', text: 'No matching export in "node_modules/y18n/build/lib/index.js" for import "default"' } ], warnings: [] }`

I can run my code by removing the line "import y18n from 'y18n" in node_modules/yargs/lib/platform-shims/esm.mjs.However, i think this is not a good choice.

Snuffleupagus commented 1 year ago

I use electron+vite+vue3 to build my app, but when I run script "npm run dev",it gives me the following problem.

Sorry, but that configuration isn't something that we use and consequently we cannot provide any support for it. The same goes for the mentioned command.

Unfortunately it's not clear, from the information provided thus far, that this is even a PDF.js related issue as such.


For future reference: When opening an issue, please provide all of the information requested in https://github.com/mozilla/pdf.js/blob/master/.github/ISSUE_TEMPLATE.md since this unfortunately isn't actionable as-is. Please also see https://github.com/mozilla/pdf.js/blob/master/.github/CONTRIBUTING.md (emphasis mine):

If you are developing a custom solution, first check the examples at https://github.com/mozilla/pdf.js#learning and search existing issues. If this does not help, please prepare a short well-documented example that demonstrates the problem and make it accessible online on your website, JS Bin, GitHub, etc. before opening a new issue or contacting us in the Matrix room -- keep in mind that just code snippets won't help us troubleshoot the problem.