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
Labels
bug Impact: Low Severity: Major vite Tickets related to vite support

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
@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

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
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
Projects
None yet
Development

No branches or pull requests

2 participants