Closed ctford closed 8 years ago
The problem seems to be based on webpage's treatment of file paths. There is a non-ASCII character in the path where I've checked out the project (/home/ctford/Código/klangmeister
- note the accent in "Código
").
So when the temporary js file outputs the HTML with fs.write(pagePath, html, 'w');
, it isn't found later on with p.open("file://" + pagePath, function (status) {...}
.
I've verified this by moving the project directory.
This might not be an issue that's worth your while solving. It appears to be in webpage, and it's not a common case. But one possible thing I might try and PR is putting the HTML in /tmp/
too. Is there a reason it's put in project root?
@ctford good catch. As a Spanish speaker, I feel like Código
should work, but oh well.
When using :optimizations :none
, the ClojureScript compiler makes certain assumptions about the relative paths between the main file :output-to
and :output-dir
which are somewhat tricky when :output-dir
is not specified. There is an implicit assumption that the dir from where the compiler is called from (in general the root folder) is special. See CLJS-1466 for an example of issues that stem from this.
To move the html to /tmp
we would need to make up for those assumptions and override :output-to
and :output-dir
appropriately so that the the three-way link between the html, the main file, and then required files is preserved.
If you are interested in this approach, look at boot-cljs-test
which needs to do all of this since all files need to be in filesets anyway.
Hi @ctford
Since this is solved for you and we don't have a burning need to move everything to /tmp
I'm going to close this issue. If more issues result from the absolute vs tmp decision, I might revise the decision.
I just added doo to my project - https://github.com/ctford/klangmeister/commit/68a6a7b756297ef68a3219e5053d486c0086aa62
When I try and run the tests, I get the following error:
ctford@champernowne ~/Código/klangmeister $ lein doo phantom test once
out/testable.js
is present and appears correct. Neither of the files intmp
seem to be there - perhaps that's the source of the problem.