TaTo30 / vue-pdf

PDF component for Vue 3
https://tato30.github.io/vue-pdf/
MIT License
442 stars 64 forks source link

Error "Module parse failed: Unexpected token (105:45); You may need an appropriate loader to handle this file type, currently no loaders are configured to process this file. See https://webpack.js.org/concepts#loaders" #153

Open SciManJD opened 3 weeks ago

SciManJD commented 3 weeks ago

I cannot make it running. I get this message:

Module parse failed: Unexpected token (105:45)
You may need an appropriate loader to handle this file type, currently no loaders are configured to process this file. See https://webpack.js.org/concepts#loaders
|   for (const d of l.getElementsByTagName("span")) {
|     let U = d.textContent;
>     const Z = JSON.parse(d.dataset.l10nArgs ?? "{}");
|     if (U)
|       for (const F in Z)

I need a little help, please...

TaTo30 commented 3 weeks ago

The problem is the ?? operator even if is a feature supported by many browsers some transpiler does not supported it, if You are using webpack 4 try to update to webpack 5 or change the "target" property to "esnext". https://github.com/webpack/webpack/issues/10227