So, I’m trying to add some external JS files for my theme to my React Meteor app, but I have several issues.
First of all, when I place the JS files inside the /imports
directory, I get a host of errors for my JS files, like ReferenceError: window is not defined
or ReferenceError: jQuery is not defined
. That tells me that the code is run server side. Wrapping the code in (Meteor.isClient){}
doesn’t provide a solution.
Then, when I place these scripts inside /client
directory, I’m not able to import modules from /client to /imports for some reason. There’s always a Error: cannot find module
error, even though the path is correct.
Anyone have any idea what’s going on? I’ve been using Meteor for over a year already and still confused at this new modular design.