Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Apexcharts does not work in production mode with Vite #14039

Closed
Artur- opened this issue Jun 23, 2022 · 4 comments
Closed

Apexcharts does not work in production mode with Vite #14039

Artur- opened this issue Jun 23, 2022 · 4 comments

Comments

@Artur-
Copy link
Member

Artur- commented Jun 23, 2022

Description of the bug

Apexcharts addon from the directory + Vite + Vaadin 23.1.1 works fine in development mode but in production mode you get a JS error

Minimal reproducible example

git clone https://github.com/Artur-/test-apexcharts
cd test-apexcharts
mvn -Pproduction

Expected behavior

A charts should be shown when opening http://localhost:8080

Actual behavior

Uncaught ReferenceError: require is not defined
    at ApexChartsWrapper.ready (generated-flow-imports.cd02bd77.js:2229:622)
    at E.ready (FlowClient.fb0b2676.js:3:77461)
    at ApexChartsWrapper._enableProperties (generated-flow-imports.cd02bd77.js:196:2486)
    at ApexChartsWrapper.connectedCallback (generated-flow-imports.cd02bd77.js:238:1559)
    at ApexChartsWrapper.connectedCallback (generated-flow-imports.cd02bd77.js:248:4997)
    at C1 (FlowClient.fb0b2676.js:3:12787)
    at CE (FlowClient.fb0b2676.js:3:45064)

Versions:

- Vaadin / Flow version: 23.1.1
@Artur- Artur- added the vite Tickets related to vite support label Jun 23, 2022
@Artur- Artur- changed the title Apexcharts does not work in production mode Apexcharts does not work in production mode with Vite Jun 23, 2022
@mshabarov mshabarov added this to Needs triage in OLD Vaadin Flow bugs & maintenance (Vaadin 10+) via automation Jun 23, 2022
@mshabarov mshabarov moved this from Needs triage to P1 - High priority in OLD Vaadin Flow bugs & maintenance (Vaadin 10+) Jun 23, 2022
@Artur-
Copy link
Member Author

Artur- commented Jun 23, 2022

This works with Vite 3 beta 0, possibly resolved by vitejs/vite#8459

@Artur-
Copy link
Member Author

Artur- commented Jun 23, 2022

@Artur-
Copy link
Member Author

Artur- commented Jun 23, 2022

A PR for Apexcharts to make this work also with Vite 2: appreciated/apexcharts-flow#134

@Artur-
Copy link
Member Author

Artur- commented Jun 23, 2022

Closing this as there is nothing that can be fixed in Flow. Either the Apexcharts PR should be applied or this will work once Flow upgrades to Vite 3 (which currently has some other issues)

@Artur- Artur- closed this as completed Jun 23, 2022
OLD Vaadin Flow ongoing work (Vaadin 10+) automation moved this from Product backlog to Done - pending release Jun 23, 2022
OLD Vaadin Flow bugs & maintenance (Vaadin 10+) automation moved this from P1 - High priority to Closed Jun 23, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Impact: Low Severity: Major vite Tickets related to vite support
Development

No branches or pull requests

2 participants