Business
Jobs
  • About Us
  • Solutions
    • Job Postings
      Post your job and receive qualified candidates in 48h.
    • Candidate Assessments
      500+ technical and psychological tests, plus anti-fraud.
    • Headhunting
      Tailor-made executive search from start to finish.
    • Payroll + EOR
      Payroll dispersal and EOR across 15+ LATAM countries.
  • Pricing
  • Jobs

0

858
Views
Error de paquete web con jsPDF en laravel/vuejs mix

Entonces, estoy tratando de usar jsPDF en mi proyecto, pero cada vez que intento importar jsPDF a mi componente vue, aparece este error:

 ERROR in ./node_modules/canvg/lib/index.es.js 1933:16-23 Module not found: Error: Can't resolve 'process/browser' in '/Users/air-1/Desktop/OneDrive - laravel projects/prevzemniDokumenti/node_modules/canvg/lib' Did you mean 'browser.js'? BREAKING CHANGE: The request 'process/browser' failed to resolve only because it was resolved as fully specified (probably because the origin is strict EcmaScript Module, eg a module with javascript mimetype, a '*.mjs' file, or a '*.js' file where the package.json contains '"type": "module"'). The extension in the request is mandatory for it to be fully specified. Add the extension to the request. webpack compiled with 1 error

Ahora dice que tengo que agregar la extensión a la solicitud, pero no tengo idea de qué significa eso... Traté de buscar una solución, pero no puedo encontrar una. Así que ahora estoy aquí.

mi paquete.json

 { "private": true, "scripts": { "dev": "npm run development", "development": "mix", "watch": "mix watch", "watch-poll": "mix watch -- --watch-options-poll=1000", "hot": "mix watch --hot", "prod": "npm run production", "production": "mix --production" }, "devDependencies": { "autoprefixer": "^10.3.7", "axios": "^0.21", "jquery": "^3.6", "laravel-mix": "^6.0.6", "lodash": "^4.17.19", "popper.js": "^1.16.1", "postcss": "^8.3.9", "resolve-url-loader": "^3.1.2", "tailwindcss": "^2.2.16", "vue": "^2.6.12", "vue-loader": "^15.9.8", "vue-template-compiler": "^2.6.12" }, "dependencies": { "jspdf": "^2.4.0", "vue-router": "^3.5.2" } }

¿Cómo puedo solucionar este error?

over 4 years ago · Santiago Trujillo
1 answers
Answer question

0

Encontré la solución.

en webpack.mix.js tuve que agregar

 mix.options({legacyNodePolyfills: false})

antes de la llamada mix.js

https://github.com/laravel-mix/laravel-mix/issues/2737

over 4 years ago · Santiago Trujillo Report
Answer question
Find remote jobs

Discover the new way to find a job!

Top jobs
Top job categories
Business
Post vacancy Pricing Sales
Legal
Terms and conditions Privacy policy
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Show me some job opportunities
There's an error!