Repository navigation
Closed
Description
Hi @sokra
When I try to require('jquery'), which is a jam module installed under web_modules, I always get the following message:
- Serving static content.
- dev-server on port 8081.
> Open http://localhost:8081/ in your browser.
Error: watch ENOENT
at errnoException (fs.js:806:11)
at FSWatcher.start (fs.js:837:11)
at Object.fs.watch (fs.js:861:11)
at module.exports (/Users/karlvanrompaey/Documents/apps/experiments/webpack/jam-app/node_modules/webpack/lib/webpack.js:223:23)
at Array.forEach (native)
at EventEmitter.<anonymous> (/Users/karlvanrompaey/Documents/apps/experiments/webpack/jam-app/node_modules/webpack/lib/webpack.js:222:19)
at EventEmitter.emit (events.js:123:20)
at writingFinished (/Users/karlvanrompaey/Documents/apps/experiments/webpack/jam-app/node_modules/webpack/lib/webpack.js:522:19)
at /Users/karlvanrompaey/Documents/apps/experiments/webpack/jam-app/node_modules/webpack/lib/webpack.js:379:30
at buildTree (/Users/karlvanrompaey/Documents/apps/experiments/webpack/jam-app/node_modules/webpack/lib/buildDeps.js:103:3)
Hash: 4732db73d220259503822d5a079cf898
Compile Time: 677ms
Chunks: 1
Modules: 6
Modules including duplicates: 6
Modules first chunk: 6
<id> <size> <filename>
dev.bundle.js
0 11 ./_template/entry.js [caching]
1 45 ./app/app.js [caching]
2 259828 ./app/web_modules/jquery/jquery.js [caching]
3 533 (webpack)/buildin/__webpack_amd_define.js [caching]
4 428 (webpack)/buildin/__webpack_amd_require.js [caching]
5 24 (webpack)/buildin/__webpack_options_amd.loader.js!(webpack)/buildin/__webpack_options_amd.loader.js [caching]
webpack: bundle is now VALID.
Jquery seems to be correctly bundled in the app and the server also works, but, I always get an error message related to watch and I am not sure whether it is save to ignore this message !!! For sure the message should not be there :-)
My setup as as follows:
wpt create jam-app
cd jam-app
npm install
Now add jam-dependencies to package.json
"jam": {
"packageDir": "app/web_modules",
"baseUrl": "app",
"dependencies": {
"jquery": "1.8.0",
"bootstrap": "2.1.1-jam.1"
}
},
Then run:
jam install
dev-server.sh
And now the error messages start to appear
Metadata
Metadata
Assignees
Labels
No labels
Type
Fields
Priority
None yet
Activity
kavaro commentedon Nov 9, 2012
Forgot to mention that you (obviously) need to require('jquery') in app.js
Without the require there is no Error message.
kavaro commentedon Nov 9, 2012
FYI: The problem seems to be solved when I change line 506 in file webpack/lib/webpack.js
from:
to
fix bug #39
sokra commentedon Nov 10, 2012
thx for your investigation. It really helped me to locate to bug.
It's not safe to ignore the error, because I think watching will not work (correctly).
for jquery with wpt there is also a wtp-module you can install with
wpt install webpack/jquery-wtp-modulekavaro commentedon Nov 10, 2012
Thanks, its my pleasure, and, thank you for the quick response time ...
Just checked and can confirm that bug is solved ...
Tried the jquery-wtp-module, it is working well and will use it. Same for the bootstrap one.
On the other hand, I will need quite a few other client side libraries like knockout, crossroads, ...
The cleanest would probably be to create wpt modules, make sure all these libraries don't pollute the global namespace and return the correct value from the require call (which the jam jquery for example does not), but,
on the other hand this would be more effort. (Actually I am wonder that maybe wpt modules could be generated
automatically based on the jam package + a few options)
@kavaro
sokra commentedon Nov 11, 2012
I don't think converting jam modules to wpt-modules is a good idea.
wpt modules are good to deeply integrate stuff into the template (like the bootstrap wpt module, with config files, webpack options etc.
For simple module purposes
npmandjamwill do the stuff.Module directories in wpt:
kavaro commentedon Nov 11, 2012
Makes sense.
Thanks for the tip on the directories, was not aware of this.