This page is not created by, affiliated with, or supported by Slack Technologies, Inc.
beginner question here, have been trying to figure this out for quite some time. For some reason https://github.com/jamiepratt/fulcro-barebones/blob/main/src/app/client.cljs#L8 I get nil. Requiring useWaverSurfer returns the object I would expect. Has someone got some further suggestions for how I can hunt down why this is happening?
here is the export of the component in question from the npm package: https://github.com/katspaugh/wavesurfer-react/blob/main/src/index.tsx#L193
my code compiles OK and there are no error messages or warnings until the code tries to create a WaveSurferPlayer component: Warning: React.createElement: type is invalid -- expected a string (for built-in components) or a class/function (for composite components) but got: undefined. You likely forgot to export your component from the file it's defined in, or you might have mixed up default and named imports.
Have you worked through the scenarios here: https://shadow-cljs.github.io/docs/UsersGuide.html#js-deps
When I am unsure, I put the resulting symbol in a js/console.log and that usually clears up what is going on
if exported with default then do we require it differently?
I required as so : ["@wavesurfer/react" :default WavesurferPlayer]
But but ["@wavesurfer/react$default" :as WavesurferPlayer] works too
what confused me is how similar a default import looks to a named import in js! see usage examples here for the component. https://github.com/katspaugh/wavesurfer-react/tree/main
import WavesurferPlayer from '@wavesurfer/react'