I'm new in Node.js and React, so please excuse me if my question is not relevant. I have an app which uses Node.js(Express) server and React for UI. I have Classes which should be used both in server and UI. My root directory is like this
--root
----server
----client
----shared
But when I try to use the files of shared
from client
, I get an error Relative imports outside of src/ are not supported.
I tried to use Lerna
for common files, but ended up with the same error.
Can anybody advise how can I solve this? Any help is appreciated.
P.S. I already tried to eject
and remove ModuleScopePlugin
from webpack configuration file, however that added new errors and didn't solve the problem.