Git Product home page Git Product logo

Comments (12)

elliottkember avatar elliottkember commented on June 3, 2024

I have this, too. Tried installing json-loader but that didn't help.

from rwb.

petehunt avatar petehunt commented on June 3, 2024

@meyer is on the case

from rwb.

elliottkember avatar elliottkember commented on June 3, 2024

@meyer is the best

from rwb.

resistdesign avatar resistdesign commented on June 3, 2024

Yey @meyer !

from rwb.

meyer avatar meyer commented on June 3, 2024

so much pressure 😓

from rwb.

resistdesign avatar resistdesign commented on June 3, 2024

Oops did not mean to close.

@meyer I made my own fork and applied your commit and now I get this:

$: rwb static

/Users/***/.nvm/versions/node/v4.2.2/lib/node_modules/rwb/node_modules/style-loader/addStyles.js:30
        if (typeof options.singleton === "undefined") options.singleton = isOldIE();
^
ReferenceError: window is not defined
    at /Users/***/.nvm/versions/node/v4.2.2/lib/node_modules/rwb/node_modules/style-loader/addStyles.js:14:1
    at /Users/***/.nvm/versions/node/v4.2.2/lib/node_modules/rwb/node_modules/style-loader/addStyles.js:9:1
    at e.exports (/Users/***/.nvm/versions/node/v4.2.2/lib/node_modules/rwb/node_modules/style-loader/addStyles.js:30:1)
    at Object.<anonymous> (webpack:///MyComponent.css?12a2:7:1)
    at t (webpack/bootstrap f9215b977c34d7bcad1b:9:1)
    at Object.<anonymous> (bundle.js:13877:24)
    at Object.<anonymous> (bundle.js:14157:28)
    at t (webpack/bootstrap f9215b977c34d7bcad1b:9:1)
    at Object.<anonymous> (bundle.js:14694:21)
    at Object.<anonymous> (bundle.js:14703:28)

from rwb.

meyer avatar meyer commented on June 3, 2024

@resistdesign yeeep, I was a little overzealous in copying the serve loaders over. Sorry about that.

from rwb.

resistdesign avatar resistdesign commented on June 3, 2024

@meyer np, it's all part of the process! :)

from rwb.

resistdesign avatar resistdesign commented on June 3, 2024

@meyer Just tried your fork at master and it worked a bit better but I'm referring to window in my app code so now I get:

const CURRENT_PROTOCOL = window.location.protocol;
                         ^
ReferenceError: window is not defined

Is that just a global that needs to be set in webpack? New issue time?

from rwb.

petehunt avatar petehunt commented on June 3, 2024

@resistdesign window is not set on purpose. Since rwb is an implementation of "isomorphic" JS, you may not have access to the browser APIs at load time.

Think about it: during the static build step, what should window.location.protocol return? Since it's not being run in an actual web page served from a web server, there's no location.protocol. Instead, you can refer to window in React lifecycle hooks that only run in the browser (i.e. componentDidMount()).

from rwb.

resistdesign avatar resistdesign commented on June 3, 2024

ah ok!

from rwb.

resistdesign avatar resistdesign commented on June 3, 2024

I did not know isomorphic was a goal for this :)

from rwb.

Related Issues (13)

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.