Closed cybertheory closed 8 months ago
I think this error comes from the server. When using server-side-rendering your component is also executed on the server and there dart:js is not available. You can fix this by using darts conditional imports: https://dart.dev/guides/libraries/create-packages#conditionally-importing-and-exporting-library-files
There is also https://docs.page/schultek/jaspr/advanced/imports to make working with them a bit easier.
Also I have used mdc also in jaspr_pad, so check out e.g. https://github.com/schultek/jaspr/blob/main/apps/jaspr_pad/lib/components/elements/button.dart and related files on how I deal with this there.
@cybertheory Can this be closed then?
Description
Trying to interoperate with JS files in order to get Material Web Components working with Caspr: https://github.com/cybertheory/caspr/tree/main/packages/caspr-material
Steps To Reproduce
dart pub global activate jaspr_cli
jaspr create -t classic my_app
dart pub add caspr-material
jaspr serve
Expected Behavior
It should run and show a MDC button. If jaspr targets web it should allow for js interop?
Additional Context Caspr extends Jaspr's component library. So this is why I am posting an issue here.