You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Hi, I 'm using fengari on a medium sized project where also some other libs are being used.
I was using a pre-npm version of fengari where a global var WEB should be present for fengari to assume it was a browser env.
I saw that now you are detecting by means of typeof process which sounds fine, but I got a problem with that in my project.
I got this process lib as a transitive dependency which is defining the process global variable, and in case it's a web environment it defines process.web as true.
So the way fengari detects web/node is failing for me now, I 'm in web but it assumes is NodeJS because process exists although it is not the NodeJS process object.
Do you think fengari could check for the existence of that process.web (that process lib seems like widely used).
If not, is there any chance to add back the WEB global variable as a way to force fengari into web mode even if process is defined?
PS: I 've already tried by using de webpack DefinePlugin and add typeof process as "undefined" but same thing happend though.
Hope you could consider any solution to this problem, I 'm happy to create a PR with the suggested approach.
Thanks in advance
The text was updated successfully, but these errors were encountered:
By looking at the comments on another Issue I understood that at the current version of fengari I must use fengari-web to avoid that kind of problem.
So there is no need for modification when using it like that.
I thought I didn't need fengari-web as I won't use the webpack loader nor script includes, but then I realized that fengari-web was also exporting what I needed from fengari and fengari-interop.
Hi, I 'm using fengari on a medium sized project where also some other libs are being used.
I was using a pre-npm version of fengari where a global var WEB should be present for fengari to assume it was a browser env.
I saw that now you are detecting by means of
typeof process
which sounds fine, but I got a problem with that in my project.I got this process lib as a transitive dependency which is defining the
process
global variable, and in case it's a web environment it definesprocess.web
astrue
.So the way fengari detects web/node is failing for me now, I 'm in web but it assumes is NodeJS because
process
exists although it is not the NodeJSprocess
object.Do you think fengari could check for the existence of that
process.web
(that process lib seems like widely used).If not, is there any chance to add back the WEB global variable as a way to force fengari into web mode even if
process
is defined?PS: I 've already tried by using de webpack DefinePlugin and add
typeof process
as"undefined"
but same thing happend though.Hope you could consider any solution to this problem, I 'm happy to create a PR with the suggested approach.
Thanks in advance
The text was updated successfully, but these errors were encountered: