Warning: React.createElement: type should not be null, undefined, boolean, or number. It should be a string (for DOM elements) or a ReactClass (for composite components).
and
Uncaught Error: Invariant Violation: Element type is invalid: expected a string (for built-in components) or a class/function (for composite components) but got: object.
So, my routes work when I import the components using es6 import at the top of my file. If I don’t use import and use let Component = require(‘path/to/file’) instead to import my components, it does not work and spits out those same errors. So, I actually think it’s not necessarily the code splitting that is broken, but with importing a component with require.
What are the known drawbacks of using this approach instead of Meteor 1.3?
Are there any more benefits than hot-reload in development, working SSR and code splitting (compared to Meteor 1.3)?
Does the hot-code-push still work in Cordova?
How does code splitting works in Cordova? Does it store the lazy required modules like the Meteor normal html, css y js and they work even if the user opens the app without connection or those lazy required modules are always send over the net and require connection?
@benoitt I added webpack-font-awesome npm package and it works on development environment, but when I try to build for production I get the following error saying that window is not defined. I’ve also tried removing the font-awesome package, but I still get this issue. Is there some webpack cache somewhere that I need to clear? Any thoughts?
=> Exited with code: 8
W20160203-21:39:32.902(-5)? (STDERR)
W20160203-21:39:32.903(-5)? (STDERR) C:\Users\panw\AppData\Local\.meteor\packages\meteor-tool\1.1.10\mt-os.windows.x86_32\dev_bundle\server-lib\node_modules\fibers\future.js:245
W20160203-21:39:32.904(-5)? (STDERR) throw(ex);
W20160203-21:39:32.904(-5)? (STDERR) ^
W20160203-21:39:32.904(-5)? (STDERR) ReferenceError: window is not defined
@benoitt,
Does code splitting in webpack mean that my app is no more served as a single js file?
I’d like to be able to split my app in two “parts”:
core meteor files, that don’t change and are cached on user’s browser
app-specific files, that change when I push updates for my app into production
When user opens the app, he should only need to download the “second part”. Is that achievable with webpack?
Code splitting means your user don’t need to load your entire app as soon as he opens the first page. He can load just what he needs and request more only when he needs it.
If you want to split the code of the libraries you’re using vs your own, you can use a common chunk by using webpack.optimize.CommonsChunkPlugin.
@benoitt Benoit, first of all, thanks for the great package! However, I miss the possibility to set the port through WEBPACK_PORT env variable. Could you please enable this possibility? I often run several meteor instances, so I have a script which finds free ports to run them, I would like to have the same for webpack dev server.
@benoitt is there an upgrade guide (or is it even necessary)? i was using this before 1.0 and am planning to update now that 1.3 is out. there is a “from scratch” section, but not a upgrade one.
@benoitt I couldn’t get Webpack + babel-root-slash-import running. I’ve added it using NPM, then created the .babelrc file and added it as a plugin. But having it set up this way doesn’t change anything.