Pricing changes are coming in January. Contact our Sales team to secure the current price for your desired license.

Failed to run npm run build on vite

Answered
TI Checkout asked 1 day ago

Hello,

 

I’m encountering an issue while trying to run the build for my application. It seems to be related to the flexmonster component, and I would appreciate your help resolving this. Below are the details:

 

Environment:

 

npm version: 10.7.0

node version: 18.20.5

vite compiler: 5.4.11

Vue version: v3

vue-flexmonster version: 2.9.92

flexmonster-cli version: 2.9.69

Error during build:

 

go

Copiar código

[vite:esbuild-transpile] Transform failed with 1 error:  

assets/flexmonster-!~{00p}~.js:2581:38133: ERROR: Unexpected "case"

 

Unexpected "case"

2579| * https://github.com/foliojs/pdfkit/blob/master/lib/security.js

2580| * http://www.fpdf.org/en/script/script37.php

2581| */var P={print:4,modify:8,copy:16,"annot-forms":32};

3 answers

Public
Maksym Diachenko Maksym Diachenko Flexmonster 21 hours ago

Hello,

Thank you for reaching out to us.

We were able to reproduce this behavior on our side. The error message indicates a bug in the Vite transpiler, which fails while attempting to transpile case statements within Flexmonster's code. We could find a workaround provided in the issue raised on Vitejs GitHub: https://github.com/vitejs/vite/issues/19147

It is recommended to use an older version of rollup - dependency used in Vite, which can be done by adding the following override to your project's package.json file:

"overrides": {
"rollup": "4.29.2"
}

After adding this to package.json, run the npm install to apply changes. This fixed the issue with vite build on our end.

Please let us know if the provided workaround works for you.

Best Regards,
Maksym

Public
TI Checkout 18 hours ago

Everything went well, thank you very much 

Public
Maksym Diachenko Maksym Diachenko Flexmonster 47 mins ago

Hello,

Thank you for your feedback.
We are glad to hear the workaround with package override worked for you.
Feel free to contact us if more questions arise.

Best Regards,
Maksym

Please login or Register to Submit Answer