Issue with remix (tsx)
Closed this issue · 3 comments
theskillwithin commented
Warning: React.jsx: type is invalid -- expected a string (for built-in components) or a class/function (for composite components) but got: object
cahilfoley commented
Hello - thanks for raising an issue - I don't use remix much, do you have a reproduction that you could share for this issue so I could try to help? Thanks.
theskillwithin commented
@cahilfoley Thank you! created remix reproduction repo https://github.com/theskillwithin/react-snowfall-remix
cahilfoley commented
Thanks for taking the time to create the repro! I've made a small tweak and release version 2.1.0 to help get this working. After bumping the version to 2.1.0 the only other change I needed to make to get it working was to add the serverDependenciesToBundle
property to the remix.config.js
file like this:
export default {
ignoredRouteFiles: ['**/.*'],
serverDependenciesToBundle: ['react-snowfall'], // The library is published as ESM and remix uses CJS so it needs to be included in the bundle
}