tuandm / laravue

Admin dashboard for enterprise Laravel applications built by VueJS and Element UI https://laravue.dev
https://laravue.dev
MIT License
2.21k stars 654 forks source link

app.css empty after import jsPDF #279

Open leonpug opened 3 years ago

leonpug commented 3 years ago

Hi, try to use jsPDF with laravue with:

import jsPDF from 'jspdf'; ... const pdfName = 'test'; const doc = new jsPDF(); doc.text('Hello World', 10, 10); doc.save(pdfName + '.pdf'); ...

after npm run dev my app.css is 0 byte! No error in compiling or in console. If I remove jsPDF import and code, everything run normally.

Any ideas? Thanks

hoangbaovu commented 3 years ago

Hi, try to use jsPDF with laravue with:

import jsPDF from 'jspdf'; ... const pdfName = 'test'; const doc = new jsPDF(); doc.text('Hello World', 10, 10); doc.save(pdfName + '.pdf'); ...

after npm run dev my app.css is 0 byte! No error in compiling or in console. If I remove jsPDF import and code, everything run normally.

Any ideas? Thanks

New version import with { jsPSF }

Try

import { jsPDF } from 'jspdf';

const doc = new jsPDF();
doc.save("a4.pdf");
leonpug commented 3 years ago

Thanks for replay It does not work.

screenshot_000

I don't know what are these files:

0.js
1.js
...
eduardoalvara2 commented 3 years ago

This is happening to me too.

"app.css" completely empty after "npm run dev"

eduardoalvara2 commented 3 years ago

Hi!, let this here to help someone with the same problem:

Update laravel-mix to v6 should fix this issue

Looks like it was a problem with webpack v4 and dynamics imports, which is fixed in v5+

Source: https://github.com/JeffreyWay/laravel-mix/issues/1870