Closed RoryDuncan closed 9 years ago
Thanks for noticing that and such a deep investigation.
Your "temporary" solution seems to be a widely accepted one:
https://github.com/jquery/jquery/blob/master/src/ajax/xhr.js#L17
I will use it for now - as an abstraction between xhr and fs has to be well thought and communicated to the user and I have to consider many things - including that using require('fs')
possibly gets in the way of browserify .
Pushed the update. Please let me know if it works.
My app wont load because of the above problem, when running nw.js v0.12.0 and PlaygroundJS r2.
I just tested in an empty playground, in case it was an oddity with my app.
I tracked it down and it seems to be from from the status code being incorrect, as the responseText is as expected, but the Status Code is tripping this conditional in the Loader.loadData function
I looked up a bit about the status code, and ran across a Stack Overflow Discussion about it.
Despite the stack overflow discussion suggesting checking the environment, a temporary fix could be:
Though that works, would we want some form of environment detection to decide to use fs when the environment is nodewebkit or to use XMLHttp when in a browser, as discussed in the SO?