infernojs / inferno

:fire: An extremely fast, React-like JavaScript library for building modern user interfaces
https://infernojs.org
MIT License
16.08k stars 635 forks source link

createBlueprint is not a function #341

Closed Citrullin closed 8 years ago

Citrullin commented 8 years ago

Got the error:

NavigationSidebar.js?2acf:2Uncaught TypeError: _inferno2.default.createBlueprint is not a function

My package.json:


{
  "name": "redux-inferno-hot-boilerplate",
  "version": "1.0.0",
  "description": "Boilerplate for Redux Inferno project with hot loading",
  "scripts": {
    "start": "node server.js",
    "lint": "eslint src"
  },
  "repository": {
    "type": "git",
    "url": "https://github.com/citrullin/redux-inferno-hot-boilerplate.git"
  },
  "keywords": [
    "redux",
    "inferno",
    "boilerplate",
    "hot",
    "reload",
    "hmr",
    "live",
    "edit",
    "webpack"
  ],
  "author": "Philipp Blum",
  "license": "MIT",
  "bugs": {
    "url": "https://github.com/citrullin/issues"
  },
  "homepage": "",
  "devDependencies": {
    "autoprefixer": "^6.4.1",
    "babel-core": "^6.0.20",
    "babel-eslint": "^4.1.3",
    "babel-loader": "^6.0.1",
    "babel-plugin-inferno": "^0.7.7",
    "babel-preset-es2015": "^6.0.15",
    "babel-preset-react": "^6.0.15",
    "babel-preset-stage-0": "^6.0.15",
    "chart.js": "^2.2.2",
    "css-loader": "^0.25.0",
    "eslint": "^1.10.3",
    "extract-text-webpack-plugin": "^1.0.1",
    "file-loader": "^0.9.0",
    "image-webpack-loader": "^2.0.0",
    "img-loader": "^1.3.1",

    "json-loader": "^0.5.4",
    "node-sass": "^3.9.3",
    "postcss-loader": "^0.13.0",
    "redux-logger": "^2.6.1",
    "sass-loader": "^4.0.2",
    "sass-mq": "^3.2.9",
    "style-loader": "^0.13.1",
    "webpack": "^1.13.2",
    "webpack-dev-server": "^1.12.1"
  },
  "dependencies": {
    "inferno": "^1.0.0-alpha8",
    "inferno-component": "^1.0.0-alpha8",
    "inferno-dom": "^1.0.0-alpha8",
    "inferno-redux": "^0.8.0-alpha2",
    "inferno-router": "^0.8.0-alpha2",
    "redux": "^3.5.2",
    "redux-thunk": "^2.1.0"
  }
}

NavigationSidebar:

import Inferno from 'inferno';
import Component from 'inferno-component';

export default class NavigationSidebar extends Component{
    render(){
        return (
            <div class={ this.props.class }>
                {this.props.children}
            </div>
        );
    }
}

And the App.js which use the NavigationSidebar:

import Inferno from 'inferno';
import Component from 'inferno-component';

import NavigationSidebar from './components/Navigation/NavigationSidebar';
import NavigationElement from './components/Navigation/NavigationElement';
import {NavigationLogo} from 'NavigationLogo';

import { getAllNavigationElements } from 'actions';
import { getVisibleNavigationElements } from 'navigationListReducer';

import { connect } from 'inferno-redux';

import "css/main";

class App extends Component {

    render(){
        var store = this.context.store;

        var navigationElements = [];
        store.getState().navigation.forEach(element => {
            navigationElements.push(
                <NavigationElement
                    name={ element.name } url={ element.url }
                    class="o-layout__item"
                />
            )
        });

        return(
            <div class="o-wrapper">
                {/* Following is the content of the current page inserted */}
                <div class="o-wrapper__content o-layout">
                    <NavigationSidebar class="o-layout__item o-1-of-5 c-navigation-sidebar">
                        <NavigationLogo/>
                        { navigationElements }
                    </NavigationSidebar>
                    <div class="o-layout__item o-4-of-5">
                        {this.props.children}
                    </div>
                </div>
            </div>
        );
    }
}

const mapStateToProps = (state) => {
  return {
    navigation: getVisibleNavigationElements(state)
  }
};

export default connect(
    mapStateToProps,
    { getAllNavigationElements }
)(App);
trueadm commented 8 years ago

You're mixing 0.8 with 1.0. That's why you're getting this error. I've not yet published the other modules for 1.0 (will do soon) such as inferno-router. They're still under development.

Citrullin commented 8 years ago

Okay. Version 1 will not backwards compatible. Thanks for the info.

trueadm commented 8 years ago

@Citrullin I've published 1.0.0-alpha8 for inferno-router and inferno-redux. No guarantees they will work, but you may have more success!

ajacksified commented 8 years ago

@trueadm is there a v1 alpha for inferno-server going up anytime soon as well? (I'm seeing the same issue there.)

trueadm commented 8 years ago

@ajacksified I've published alpha8 of inferno-server too. Again, no guarantees it will work. :) Have fun!

ajacksified commented 8 years ago

@trueadm no dice, using inferno-compat (v1 alpha 7) - I'll wait a bit, and provide more info when I get a little more time.

trueadm commented 8 years ago

@ajacksified I published alpha8 of inferno-compat, does that do any better?

trueadm commented 8 years ago

@ajacksified if you're not already, you should get on the Inferno Slack so I and the others can help you more :) email me your email address at dg@domgan.com and I'll get you an invite (as this issue has been derailed a bit).