Comments (4)
@m-a-r-c-e-l-i-n-o this is a bug caused by the fact that I forgot to take into consideration the fact that some people might not have their package.json found when I wrote this line:
chokidar-socket-emitter/server.js
Line 66 in 29e7ace
I have fixed that in release 0.5.1 by disabling this socket.io handler if pjson doesn't exist.
from chokidar-socket-emitter.
Thank you for the quick response. Have you considered that by resolving it that way, you are stripping the "Programatic" version of this feature: https://github.com/capaj/systemjs-hot-reloader/blob/master/hot-reloader.js#L58 ? The require for the "Programatic" will always fail, so it's more of a "require vs failure to require" issue than a "package.json vs no package.json" issue. Is there really no way to get that require working properly for both the "CLI" and "Programatic" versions?
from chokidar-socket-emitter.
@m-a-r-c-e-l-i-n-o programmatic will only fail when it can't find package.json. You're right that we could improve on that. Locating package.json is not very clever. I will take a look into improving that and I will also add a warning when we don't have package.json required succesfully.
from chokidar-socket-emitter.
Sorry, I don't think I explained myself well enough. My main concern is with the "Programmatic" version when being ran by jspm (i.e. jspm run my-node-server-file.js
). When running the "Programmatic" version via plain ol' node/npm (i.e. node my-node-server-file.js
), everything behaves as expected. It's true that for the "node my-node-server-file.js
- Programmatic" we can do a little bit of a better job finding the JSON (since it's path starts at the script's location), but that can easily be resolved by passing the appropriate "dir" parameter. The real issue is that when doing jspm run my-node-server-file.js
, even with the correct "dir" parameter, the require fails. It fails every time for anything outside the "jspm_packages/npm/chokidar-socket-emitter" directory, so my "package.json" located at the root of my project, will never be required. Seems like there is an inconsistency with the way jspm treats require functions that would need to be accounted for. Not sure if it's a jspm bug, or if there is a proper way of handling these cases that I'm not aware of. Does this help clarify my concern?
from chokidar-socket-emitter.
Related Issues (16)
- baseURL support HOT 3
- Errors in Windows HOT 2
- Simple Way of Excluding Files / Paths HOT 1
- Exception when client connects with 0.5.0 release HOT 3
- When chokidar-socket-emitter running via npm it fails HOT 1
- Symlink doesn't trigger change detection HOT 3
- Supplying current socket.io HOT 3
- Allow custom ignore paths for chokidar HOT 2
- default ignored dirs no longer ignored after path resolution HOT 1
- Make logging optional HOT 3
- List all available options in the README.md
- Detect is emitter already running HOT 6
- required node version not made clear HOT 2
- Error: watch jspm_packages/npm/[email protected]/lib/__mocks__/fetch.js ENOSPC HOT 3
- CPU spike if jspm_packages is not in root dir
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 chokidar-socket-emitter.