Coder Social home page Coder Social logo

Comments (9)

bdefore avatar bdefore commented on June 30, 2024

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.

jazzido avatar jazzido commented on June 30, 2024

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.

bdefore avatar bdefore commented on June 30, 2024

OK, thanks. I'll look into this further.

from universal-redux.

jazzido avatar jazzido commented on June 30, 2024

this branch reproduces this issue: https://github.com/jazzido/universal-redux-starter/tree/root-component-example

from universal-redux.

jazzido avatar jazzido commented on June 30, 2024

For further reference, this is the webpack-asset.json file before the upgrade: https://gist.github.com/jazzido/6581cf82ebfe2e56e0aa

from universal-redux.

bdefore avatar bdefore commented on June 30, 2024

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
screen shot 2016-03-01 at 10 02 48 am

from universal-redux.

jazzido avatar jazzido commented on June 30, 2024

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.

jazzido avatar jazzido commented on June 30, 2024

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.

jazzido avatar jazzido commented on June 30, 2024

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 importend because I wasn't importing getRoutes from my routes.js.

Thanks again!

from universal-redux.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo 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.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.