Open seasonwarm opened 8 years ago
@seasonwarm sorry for taking absolutely ages to get back to you – I have no idea why I never saw the notification for this. It sounds like you're using something that adds a global window
variable? I'm not too familiar with nwjs
but I'd maybe ask why this is the case? Are they using jsdom
or some other library that adds to globals?
nwjs and Electron both add require
to the global space which is why this causes issues. It also adds module
IIRC.
I'll try to get a PR in for a more accurate check on these platforms in a few days. I'm using it in Electron too so will come into this issue soon enough.
@davemackintosh Thank you! Also, would you mind jumping onto the Inferno slack? https://inferno-slack.herokuapp.com/ It's also the home of t7 :)
Sure thing bud
On 15 Jan 2017 6:04 p.m., Dominic Gannaway notifications@github.com wrote:
@davemackintoshhttps://github.com/davemackintosh Thank you! Also, would you mind jumping onto the Inferno slack? https://inferno-slack.herokuapp.com/ It's also the home of t7 :)
- You are receiving this because you were mentioned. Reply to this email directly, view it on GitHubhttps://github.com/trueadm/t7/issues/21#issuecomment-272712134, or mute the threadhttps://github.com/notifications/unsubscribe-auth/ABXUgXMrbzLXn5LzQpRM0zoduthmq3Jyks5rSl-ngaJpZM4I-elG.
it have something wrong with react、nwjs when 'require("t7")'; wrong:
.\node_modules\t7\t7.js:818 Uncaught TypeError: t7._cache[templateKey] is not a function
i think:
//we store created functions in the cache (key is the template string);
var isBrowser = typeof window != "undefined" && document != null
when browser isBrowser is true when node isBrowser is false (i did't test) but when nwjs and require a js file,isBrowser is true i think isBrowser should be falseit maybe just differenct from
require
or<script src=''>
2 reference methodsoh it maybe wrong about my think,but i hope it can run on nwjs(require) soon
thank you