Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

it have something wrong with nwjs when 'require("t7")' #21

Open
seasonwarm opened this issue Jun 26, 2016 · 4 comments
Open

it have something wrong with nwjs when 'require("t7")' #21

seasonwarm opened this issue Jun 26, 2016 · 4 comments

Comments

@seasonwarm
Copy link

seasonwarm commented Jun 26, 2016

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 false

it maybe just differenct from require or <script src=''> 2 reference methods

oh it maybe wrong about my think,but i hope it can run on nwjs(require) soon

thank you

@trueadm
Copy link
Owner

trueadm commented Nov 20, 2016

@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?

@davemackintosh
Copy link
Contributor

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.

@trueadm
Copy link
Owner

trueadm commented Jan 15, 2017

@davemackintosh Thank you! Also, would you mind jumping onto the Inferno slack? https://inferno-slack.herokuapp.com/ It's also the home of t7 :)

@davemackintosh
Copy link
Contributor

davemackintosh commented Jan 15, 2017 via email

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants