Comments (9)
I've noticed these warnings too, and unfortunately there's no way to disable them. They only appear to appear with a fresh npm install
but do not appear to impact anything. Are you able to load your page?
from universal-redux.
They're errors, and they prevent the page from being loaded. CSS loading is now broken:
ERROR GENERATING ROOT COMPONENT [TypeError: Cannot read property 'app' of undefined] TypeError: Cannot read property 'app' of undefined
[1] at App.render (App.js:51:27)
That undefined
is the styles
object in App.js
:
import styles from '../../scss/main.scss';
// ...
This is webpack-assets.json
after the upgrade:
{
"javascript": {
"main": "http://localhost:3001/dist/main-9356d1a73beb183b5b4f.js"
},
"styles": {},
"assets": {}
}
assets
is not empty in the working version (rc27
).
from universal-redux.
OK, thanks. I'll look into this further.
from universal-redux.
this branch reproduces this issue: https://github.com/jazzido/universal-redux-starter/tree/root-component-example
from universal-redux.
For further reference, this is the webpack-asset.json
file before the upgrade: https://gist.github.com/jazzido/6581cf82ebfe2e56e0aa
from universal-redux.
I notice that your branch is still using 3.0.0, you should update that to 3.0.1. When I do and run npm run dev
, I see the isomorphic tools error in the output on startup, but the styles load fine for me.
My webpack-assets.json after running:
{
"javascript": {
"main": "http://localhost:3001/dist/main-3f57a9e6d68148ed25a7.js"
},
"styles": {},
"assets": {
"./src/containers/App/App.scss": {
"App": "App___3USOb",
"_style": ".App___3USOb {\n font-weight: bold;\n}\n"
}
}
}
This is on node 5.3 and npm 3.3.12
from universal-redux.
I can confirm that ^3.0.1
works on my repro branch. Unfortunately, it is still broken on my main project.
I set the debug
flag to true
in webpack-isomorphic-tools.config.js
and spotted some differences in the output of the build process and in the generated webpack-stats.json
file.
When using UR 3.0.2
, the webpack-stats.json
file does not contain any reference whatsoever to my .(s)css
files. When using UR 3.0.0-rc27
(last revision that works), the build process works and I get these entries in the build process output:
[webpack-isomorphic-tools/plugin] [debug] ------------------- Started -------------------
[webpack-isomorphic-tools/plugin] [debug] running write assets webpack plugin
[webpack-isomorphic-tools/plugin] [debug] writing webpack stats to /Users/manuel/Work/spendview/webapp/webpack-stats.json
[webpack-isomorphic-tools/plugin] [debug] getting javascript and styles for chunk "vendor"
[webpack-isomorphic-tools/plugin] [debug] (got javascript)
[webpack-isomorphic-tools/plugin] [debug] getting javascript and styles for chunk "main"
[webpack-isomorphic-tools/plugin] [debug] (got javascript)
[webpack-isomorphic-tools/plugin] [debug] (got style)
[webpack-isomorphic-tools/plugin] [debug] No filter specified for "images" assets. Using a default one.
[webpack-isomorphic-tools/plugin] [debug] No path parser specified for "images" assets. Using a default one.
[webpack-isomorphic-tools/plugin] [debug] parsing assets of type "images"
[webpack-isomorphic-tools/plugin] [debug] time taken: 2 ms
[webpack-isomorphic-tools/plugin] [debug] No filter specified for "fonts" assets. Using a default one.
[webpack-isomorphic-tools/plugin] [debug] No path parser specified for "fonts" assets. Using a default one.
[webpack-isomorphic-tools/plugin] [debug] parsing assets of type "fonts"
[webpack-isomorphic-tools/plugin] [debug] time taken: 1 ms
[webpack-isomorphic-tools/plugin] [debug] No filter specified for "videos" assets. Using a default one.
[webpack-isomorphic-tools/plugin] [debug] No path parser specified for "videos" assets. Using a default one.
[webpack-isomorphic-tools/plugin] [debug] parsing assets of type "videos"
[webpack-isomorphic-tools/plugin] [debug] time taken: 0 ms
[webpack-isomorphic-tools/plugin] [debug] No filter specified for "svg" assets. Using a default one.
[webpack-isomorphic-tools/plugin] [debug] No path parser specified for "svg" assets. Using a default one.
[webpack-isomorphic-tools/plugin] [debug] parsing assets of type "svg"
[webpack-isomorphic-tools/plugin] [trace] Adding assset "./src/components/ChartSelect/icon_area_chart.svg", module id 1063 (in webpack-stats.debug.json)
[webpack-isomorphic-tools/plugin] [trace] Adding assset "./src/components/ChartSelect/icon_bar_chart.svg", module id 1064 (in webpack-stats.debug.json)
[webpack-isomorphic-tools/plugin] [trace] Adding assset "./src/components/ChartSelect/icon_line_chart.svg", module id 1065 (in webpack-stats.debug.json)
[webpack-isomorphic-tools/plugin] [trace] Adding assset "./src/components/ChartSelect/icon_treemap_chart.svg", module id 1066 (in webpack-stats.debug.json)
[webpack-isomorphic-tools/plugin] [debug] time taken: 2 ms
[webpack-isomorphic-tools/plugin] [debug] parsing assets of type "style_modules"
[webpack-isomorphic-tools/plugin] [trace] Adding assset "./src/components/DescriptionText/DescriptionText.scss", module id 311 (in webpack-stats.debug.json)
[webpack-isomorphic-tools/plugin] [trace] Adding assset "./src/containers/AggregationView/AggregationView.scss", module id 312 (in webpack-stats.debug.json)
[webpack-isomorphic-tools/plugin] [trace] Adding assset "./src/scss/main.scss", module id 313 (in webpack-stats.debug.json)
[webpack-isomorphic-tools/plugin] [trace] Adding assset "./~/rc-slider/assets/index.css", module id 655 (in webpack-stats.debug.json)
[webpack-isomorphic-tools/plugin] [trace] Adding assset "./src/components/CurrencyWords/hint.css", module id 656 (in webpack-stats.debug.json)
//....snip
Does that ring any bell?
Thanks again~!
from universal-redux.
Additional datapoint: webpack-stats.json
does not contain any reference to my modules in ./src/components
or ./src/containers
. It does contain references to modules in ./src/redux/{reducers,middleware}
and some of my other .js files.
from universal-redux.
Found it. my rootClientComponent
was using a pre-3.0.0 API. For future reference, this is how it should look like:
import React from 'react';
import { Provider, connect } from 'react-redux';
import { Router, browserHistory } from 'react-router';
import { ReduxAsyncConnect } from 'redux-async-connect';
import getRoutes from './routes';
export default (store, providers, devComponent) => {
const component = (
<Router render={(props) => <ReduxAsyncConnect {...props} />} history={browserHistory}>
{getRoutes(store)}
</Router>
);
const root = (
<Provider store={store} key="provider">
{component}
</Provider>
);
return Promise.resolve(root);
};
It appears that my components were not being import
end because I wasn't importing getRoutes
from my routes.js
.
Thanks again!
from universal-redux.
Related Issues (20)
- onEnter can't redirect HOT 1
- How to access external server api (rails or laravel ... etc) from universal-redux?
- [webpack-isomorphic-tools] (waiting for the first Webpack build to finish)
- how the server side API requests handle the jwt token?
- Move to redux-connect HOT 1
- Help required?
- Question about waiting for Server Requests HOT 1
- Question about โAdd routes, reducer and rootClientComponent aliases so that client has access to themโ HOT 5
- Setting scroll behavior for the router
- SVG Loading Configuration
- Different CSS idents cause server render to be discarded HOT 1
- Using npm dependencies listed in Universal-redux on the project level HOT 3
- Question: how to alter the JS loader HOT 4
- Passing Express request headers to Html component?
- @@router/UPDATE_LOCATION fired after first dispatched action HOT 3
- Server-side React render was discarded HOT 5
- Use redux-devtools-extension HOT 1
- integrate HappyPack
- should user other way to compile es6-7 with babel
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. ๐๐๐
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google โค๏ธ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from universal-redux.