Comments (7)
I logged more info at http://stackoverflow.com/questions/24119506/karma-jasmine-times-out-without-running-tests but there's no activity on it.
from karma-webpack.
+1
from karma-webpack.
My stuff was working and now I have hit this... ugh
from karma-webpack.
So I tweaked index.js with this.
var sha1 = function(data) {
var hash = crypto.createHash('sha1');
console.info("SHA1 DATA: " + data);
hash.update(data);
return hash.digest('hex');
};
function createPreprocesor(/* config.basePath */basePath, webpackPlugin, logger, config) {
var log = logger.create("preprocessor.webpack");
return function(content, file, done) {
webpackPlugin.karmaWaitsForPreprocessing = true;
webpackPlugin.addFile(file.path);
// recompile
webpackPlugin.server.invalidate()
log.info("basePath: " + basePath);
log.info("file.path: " + file.path);
// read blocks until bundle is done
webpackPlugin.readFile(path.relative(basePath, file.path), function(err, content) {
log.info("CONTENT BLOCK: " + content);
if(!content){
log.error('ERROR!!! NO CONTENT to process for hash!');
log.error('ERROR!!! err: ' + err);
return
}
webpackPlugin.karmaWaitsForPreprocessing = false;
// Hack: file.sha
//
// Karma v0.12 assumes preprocessing is idempotent - always returns the same result on the same input.
// That's not true with karma-webpack. Not setting file.sha causes browser to use a cached file.
file.sha = sha1(content);
done(err, content && content.toString("utf-8"));
});
};
}
Which now gives me a better error:
╰─○ karma start
KarmaConfig: [object Object]
INFO [karma]: Karma v0.12.22 server started at http://localhost:9876/
INFO [launcher]: Starting browser Chrome
Hash: 606dfda4c9d20a78987a
Version: webpack 1.3.3-beta2
Time: 30ms
Asset Size Chunks Chunk Names
index.html 1129 [emitted]
webpack: bundle is now VALID.
webpack: bundle is now INVALID.
INFO [preprocessor.webpack]: basePath: /Users/nem/code/github/nmccready/rmaps/map
INFO [preprocessor.webpack]: file.path: /Users/nem/code/github/nmccready/rmaps/map/spec/app/karmaSanity.spec.coffee
INFO [preprocessor.webpack]: CONTENT BLOCK: undefined
ERROR [preprocessor.webpack]: ERROR!!! NO CONTENT to process for hash!
ERROR [preprocessor.webpack]: ERROR!!! err: Error: Path doesn't exists /_js/spec/app/karmaSanity.spec.coffee
Hash: d86dd6b2d6a1a0181b3c
Version: webpack 1.3.3-beta2
Time: 74ms
Asset Size Chunks Chunk Names
_js/spec/app/karmaSanity.spec.coffee 2003 0 [emitted] spec/app/karmaSanity.spec.coffee
_js/spec/app/karmaSanity.spec.coffee.map 2320 0 [emitted] spec/app/karmaSanity.spec.coffee
index.html 1129 [emitted]
chunk {0} _js/spec/app/karmaSanity.spec.coffee, _js/spec/app/karmaSanity.spec.coffee.map (spec/app/karmaSanity.spec.coffee) 421 [rendered]
from karma-webpack.
Turned out the plugin
new HtmlWebpackPlugin
template: 'app/html/index.html'
was causing all the ruckas. I will PR my logging changes as I feel it is helpful.
from karma-webpack.
Hi @nmccready Im having the same issue, and im also using HtmlWebpackPlugin
, did you manage to find a resolution?
from karma-webpack.
I can't remember if I made a PR or if it got shot down. Anyways the work is here https://github.com/realtymaps/karma-webpack and https://github.com/nmccready/karma-webpack
from karma-webpack.
Related Issues (20)
- 5.0 crashes on MacOS (Preprocessor, Plugin), fixed on master -> Release 5.1? HOT 7
- Trying to add karma-webpack to angular karma config HOT 2
- karma.conf.js being treated as entrypoint results in many errors from webpack 5 HOT 2
- Webpack Errors being reported twice.
- Process is not defined HOT 1
- Error during file loading or preprocessing HOT 7
- Webpack file cache isn't generated when webacpack watch option is false/nothing
- karma-webpack does not respect webpack mode = "production" HOT 3
- I have the same problem. HOT 1
- preprocessor change between v4 & v5 leading to error when used with karma-mocha HOT 15
- Issue with Webpack 5 unable to find file 404 (works with webpack 4) HOT 1
- Don't warn overriding [name].js to [name].js
- Figure out a publishing Github Workflow
- Ensure all project dependencies have no auditing issues
- Provide a migration path from karma-webpack
- Update the README.md
- Release 5.0.1 HOT 6
- Support Node >= 10 in 5.0.2 HOT 1
- Webpack `optimization` configuration is not supported anymore
- Webpack configuration 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 karma-webpack.