Comments (12)
I have this, too. Tried installing json-loader but that didn't help.
from rwb.
@meyer is on the case
from rwb.
@meyer is the best
from rwb.
Yey @meyer !
from rwb.
so much pressure 😓
from rwb.
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.
@resistdesign yeeep, I was a little overzealous in copying the serve
loaders over. Sorry about that.
from rwb.
@meyer np, it's all part of the process! :)
from rwb.
@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.
@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.
ah ok!
from rwb.
I did not know isomorphic was a goal for this :)
from rwb.
Related Issues (13)
- shim() doesn't support image loaders HOT 1
- Cannot find module myapp/init HOT 2
- rwb static writes bundle.js and styles.css to system root directory HOT 3
- Doesn't build on iojs 3.0 or node.js 4.0 HOT 2
- Error when used with ParseReact HOT 1
- CORS HOT 2
- React 0.14? HOT 3
- testing recommendation HOT 3
- Does not work out of the box for me HOT 3
- '//@ sourceURL' and '//@ sourceMappingURL' are deprecated, please use '//# sourceURL=' and '//# sourceMappingURL=' instead. HOT 2
- Babel 6 support?
- Link to create-react-app? HOT 1
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 rwb.