Any way to force explicit imports?


#1

Ok, not using the imports folder finally bit me in the ass. :slight_smile:

import { Meteor } from 'meteor/meteor';
import React, { Component } from 'react';
import { createContainer } from 'meteor/react-meteor-data';
import { connect } from 'react-redux';

import LoginBox from '../components/LoginBox';
console.log(LoginBox);
export default connect()(createContainer(_ => {
  return {
    yes: true,
  }
}, LoginBox))

LoginBox comes up as undefined, I’m guessing because this code above (the container) loads up before the LoginBox component is done processing. I just figured importing something would always work, but apparently this isn’t the case. If I move LoginBox.js to ../components/imports/LoginBox.js, the above works just fine.

Is there some way (even a hack) to just make nothing implicit/lazy load? I’d rather not shove my entire app into an imports folder.


#2

Did you figure this out? There must be something else going on here. The way modules work ensure that all required modules are loaded before the modules that require them. What does LoginBox.js look like?


#3

Too late, I already refactored and put everything in imports. I’m on a really fast roll towards launch of my first major SaaS, I didn’t want to waste time :slight_smile:


#4

Seems like this worked out for the best! All down hill from here. Looking forward to your upcoming post in announce:smiley: