Premium support for our pure JavaScript UI components


Post by damir »

What is the correct way to load the CSS from thin package?

At the moment the CSS files included are:

@import '@bryntum/core-thin/core.material.css';
@import '@bryntum/grid-thin/grid.material.css';
@import '@bryntum/scheduler-thin/scheduler.material.css';
@import '@bryntum/schedulerpro-thin/schedulerpro.material.css';
@import '@bryntum/gantt-thin/gantt.material.css';

and this seems to works locally, but since I have an error after production build and I also notice that font-awesome are included in each of this, I would like to know if this is correct way.

The error which I am getting is

TypeError: Cannot read properties of undefined (reading 'cssVersion').

cssVersion in the code seem a prop of bryntum

!globalThis.bryntum.cssVersion

See attachment in which part of the code.

Thanks


Post by damir »

Screenshot 2024-02-27 133147.png
Screenshot 2024-02-27 133147.png (18.81 KiB) Viewed 235 times

Post by damir »

I think that is nothing to do with bryntum but something else.


Post by tasnim »

Hi,

Your code looks correct. Is it possible to share a runnable test case with us so we can check what could be wrong?
Do you see any warnings in the console?


Post by damir »

I suspect that this issue is caused by Power App Canvas App, which somehow isolate window object.
I notice this with another app, and by using globalThis worked, but not using window object.
You use almost everywhere globalThis, but not in entry.js where you define first time using window.bryntum, see attached screenshot.

Screenshot 2024-02-27 144031.png
Screenshot 2024-02-27 144031.png (49.21 KiB) Viewed 228 times

For now I think is better to switch the type of app, where this problem doesn't happen.


Post by marcio »

Hey damir,

Thanks for sharing your insights.

If you're able to build a runnable app for us to debug and open a ticket to fix that if needed, that would be really nice.

Best regards,
Márcio


Post Reply