Comments (7)
Ok than it should ignore net
and tls
in the browser
field in the package.json
. You propably want to submit a PR to request
adding this field.
{
"browser": {
"net": false,
"tls": false
}
}
Or you can do it globally in the webpack configuration with:
{
node: {
net: "empty",
tls: "empty"
}
}
from react-starter.
I don't think this library is intended for in-browser usage...
from react-starter.
{
"browser": {
"net": false,
"tls": false
}
}
Does not seem to be a part of the package.json spec. I can't see any documentation here https://docs.npmjs.com/files/package.json.
Is this is a convention that webpack uses?
Thanks.
**Edit:
Is it related to this spec? https://github.com/defunctzombie/package-browser-field-spec
from react-starter.
Yes originally the library is not intended to work in the browser but now it works. I am using it inside React components to make HTTP calls to node.js server. As far as I know both request and superagent (https://github.com/visionmedia/superagent) can be used as alternatives to jQuery AJAX
I guess most people that are using React are not interested of using jQuery so they need something to communicate with the server. The theory for isomorphic apps :) - http://www.slideshare.net/spikebrehm/2014-0313fluent - says that we have environment agnostic libs (this is the case with request) and shimmed per environment (this is the case for superagent - it has browser property inside package.json to denote browser script that must be included during the build)
I just tried to use superagent instead of request....the webpack build now does not have errors but have warnings.
I am really curious what is the best approach of using one of these in the browser with webpack...
from react-starter.
It works with 'node' parameter in webpack configuration. Thanks for the fast answer.
from react-starter.
This is help for me! Thanks for you
from react-starter.
any practical solution for this issue? or I have to push the 'eject' and leave the starter?
from react-starter.
Related Issues (20)
- Can't find container issue HOT 1
- What is best way to handle user authentication?
- Cannot find module 'tapable' HOT 8
- Does not work with current version of react-router 1.0.0 HOT 1
- Can's see any css style in page
- Failed Proptype warning
- [OUTDATED]? HOT 3
- npm start
- wwe
- Help me :( Can't start webpack-dev-server
- Get requested domain?
- Error defining includePaths for sass-loader HOT 1
- Request: a way to use the production React build with this HOT 2
- No easy way to include "global" CSS HOT 1
- How to exclude files from prerender? HOT 2
- Where to put <head> HOT 2
- dev server should proxy api instead of vice versa
- Plugin system?
- React Router injected `query` prop
- vagrant installation method issues HOT 5
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 react-starter.