Custom thumbnail for CRA 4 #160
-
Hello, I'm having trouble using the render prop to define a custom thumbnail when trying to use custom slides from youtube, I try to use this example, and having an error when I define a custom thumbnail:
If I don't use the thumbnail plugin, it works well, but if not, I have an error like Is there any solution to it? Also I'm using this to handle the imports My versions are:
|
Beta Was this translation helpful? Give feedback.
Replies: 1 comment 3 replies
-
It's really hard to guess what exactly is wrong in your case since you are not showing your code. You mention one compile time error and another one seems to be a runtime error. craco v6 workaround should work fine in your case. Please consider posting a complete example on CodeSandbox if you are still experiencing this issue. |
Beta Was this translation helpful? Give feedback.
Migrating off CRA (react-scripts) is the best long-term investment since CRA is barely maintained by Meta. Vite is an amazing alternative.
Upgrading to CRA 5 (because CRA 4 is severely outdated) would solve all of your TS errors as you'd no longer need to hack the subpath module imports.
Craco is the best workaround if you must stay on CRA 4. It's a trivial price to pay if you must continue using outdated toolchain.
The following import seems to trick TypeScript into importing the correct plugin path and applying the intended module augmentation.