custom templates work locally but not in build version

I have an app that I have built and can run in dev with local data. The schedule has a custom editor template. This works fine when I run with local events and in "npm ruin dev". I see the custom template when I open the event for editing. When I build an deploy, the app gets data from an Axios call and the data is parsed into an array and loaded into the schedule component. At this point, the template breaks and the editor has only a text string in the box and no controls. I have not yet been able to find a cause for this. 


3 Replies

VR Vijay Ravi Syncfusion Team September 23, 2024 06:11 AM UTC

Hi Daniel Walker,

We suspect that the issue you're encountering might be related to the use of runtime-only template elements, such as those created using createApp. By default, Vite does not support inline templates, and if they're being used in your application, this could lead to warnings or cause the sample to not function as expected.

To address this, one potential solution is to configure an alias in your vite.config.js file. Here's an example configuration that might help:

[vite.config.js]

export default defineConfig({

  plugins: [vue()],

  resolve: {

    alias: {

      vue: 'vue/dist/vue.esm-bundler.js'

    }

  }

 })



Documentation : https://ej2.syncfusion.com/vue/documentation/common/template

Could you please try implementing this on your end and see if it resolves the issue? Let us know if the problem persists, and we can explore further.



DW Daniel Walker replied to Vijay Ravi September 23, 2024 12:29 PM UTC

So, that makes total sense and I suspected it was the original problem. However, after reinstalling the node modules a few times and restructuring my code, it appears to work now. An interesting observation for me is that I discovered more than one issue based on what I was doing and events would not render because there were multiple issues and not just one. I restructured to start from a base and got it working and then added features, testing each new feature and so far that is currently working.



VR Vijay Ravi Syncfusion Team September 24, 2024 05:02 AM UTC

Hi Daniel Walker,


We are glad to know that your issues have been resolved. Please get back to us if you need any further assistance.


Regards,

Vijay 



Loader.
Up arrow icon