I'm using scroll-to-element in a React app that pre-renders on the server. When requiring scroll-to-element, which is dependent on scroll-to, I get Error: Cannot find module 'tween'.
I believe this is because scroll-to requires component-tween via var Tween = require('tween'); which works in browser environments because of the following in package.json.
"browser": {
"raf": "component-raf",
"tween": "component-tween"
},
everything works fine in the client, but the application errors out when running on the server because node doesn't know what tween is.
I'm using scroll-to-element in a React app that pre-renders on the server. When requiring scroll-to-element, which is dependent on scroll-to, I get
Error: Cannot find module 'tween'.I believe this is because scroll-to requires
component-tweenviavar Tween = require('tween');which works in browser environments because of the following in package.json.everything works fine in the client, but the application errors out when running on the server because node doesn't know what
tweenis.