Open danielepolencic opened 9 years ago
From what I understand this is an issue to do with source maps. It's probably not an easy fix.
Any insight / suggestions welcome, though. :smile:
I borrowed the code from mattdesl/test-electron-source-maps and ran few tests.
When I run hihat test
I can't get the source maps to work.
When I run npm run electron
, source map works fine (after the first attempt).
Is there any settings in hihat
that may prevent source maps to work properly? Perhaps a race condition?
EDIT: I changed this line and hardcoded the index.html
file generated in test-electron-source-maps
:
.listen(port, host, function () {
var hostname = (host || 'localhost')
var uri = 'http://' + hostname + ':' + port + '/'
emitter.emit('connect', {
uri: 'file:///Users/danielepolencic/Sites/test-electron-source-maps/index.html'
})
})
and the source map works just fine. I guess the issue could be somewhere between the watchify server and serving the file?
Thanks for looking into this. I'll have to take a closer look this week.
There are two outstanding bugs that are causing issues with source maps. https://github.com/Jam3/hihat/issues/17 https://github.com/Jam3/hihat/issues/18
You should be able to get around them by serving the bundle under a different name, eg:
hihat index.js --serve bundle.js
Then, make sure to refresh after the first run. Hopefully I can figure out why this is happening so it can be properly fixed. If you're experiencing a different issue, let me know. :smile:
Just to recap: this bug is actually 2 bugs.
As for the latter, I found out why: https://github.com/substack/tape/issues/192
This has nothing to do with hihat
.
If the sourcemap bug is already logged as another ticket, this issue can be closed as a duplicate.
Hello,
I have the following snippet of code:
When I run the script through
node
I get:However when I run the same code in
hihat
I get:The error in the assert is pointing to
tape
and not the test. Line numbers are not matching either. Any idea how this could be fixed?