I’m having trouble understanding how server-only imports work in client-server mixed code. I’m getting an error in one of my files which is based on this example. A ValidatedMethod executes some server-side code in a client-server file, splitting it using
What I don’t understand is, in that same file the server-side code should be imported somewhere like this:
import MMR from 'xxx /server/MMR.js';
Which, when you start your app should throw an error like this on the client (server is obviously fine):
Uncaught Error: Cannot find module 'xxx/server/MMR.js''.
How is this working? How do you import and use server-only code inside a mixed client-server file without using
Another Stack Overflow issue about this.