Import issue : You may need an additional loader to handle the result of these loaders.
jasonakon opened this issue ยท 15 comments
Are you trying to import it in a nodejs file, or in a frontend js file?
Hi, in frontend js file
I had a similar issue about these but I thought it was fixed. Probably is caused by the npm version because in my tests I did not encounter it. Anyway I will remove the optional chaining package asap.
Thanks for sharing the template. I am encountering the same issue that @jasonakon reported after I imported the package.
Any update on this issue? When will you be fixing this?
Yeah, I'll do my best. I think this weekend I'll publish new version.
Adding stdout text copy paste here for searchability
Error: ./node_modules/jspdf-invoice-template/src/index.js 90:22
Module parse failed: Unexpected token (90:22)
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
| orientationLandscape: props.orientationLandscape || false,
| logo: {
> src: props.logo?.src || "",
| width: props.logo?.width || "",
| height: props.logo?.height || "",
Is updating the ECMAScript target sufficient to resolve the modern syntax?
i.e. was the loader issue caused by 3751f8b#diff-b55cdbef4907b7045f32cc5360d48d262cca5f94062e353089f189f4460039e0
The babel plugin would have fixed this?
78e7838#diff-09c56b2bf95de2a608a36afef3b6893146a959d6739be0a154dc9c9f02d80f24
I used a quick online transpiler tool to fill the modern syntax into compatible js for those optional chaining accessors etc ./node_modules/jspdf-invoice-template/src/index.js 90:22
to start prototyping with it faster (unreadable code, though).
TypeScript <3
Thank you for the package.
Looking forward to seeing how you update this.
I used a quick online transpiler tool to fill the modern syntax into compatible js for those optional chaining accessors etc
./node_modules/jspdf-invoice-template/src/index.js 90:22
to start prototyping with it faster (unreadable code, though).TypeScript <3
Thank you for the package.
Looking forward to seeing how you update this.
Thanks man! I'll do my best. I have been too busy and couldn't do the updates till now. I think and hope these days I'll push them.
Please, can someone let me know which version of nodejs and npm have you installed?
Cmd commands:
npm -v and node -v
npm version 6.14.13 and node version 14.17.2
@bhasshaw please, can you try to update npm and then try if this issue is still present? (I'm trying to understand the issue so I can leave the optional chaining package). Thank you!
I'm using a .nvmrc file with the node version 14.17.2, that then determines the npm version of 6.14.13 so there is no updating it beyond that.
I updated node to 16.5.0 and nvm updated npm to 7.19.1 and now it works.
I'm gonna close this issue due to the fix done in version 1.3.2