Any way to force explicit imports?

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';
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.

1 Like

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?

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:

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

1 Like