1

I'm trying to add a javascript library that requires a popup window for the user to log in, and when I call the library I can see the following error:

Possible Unhandled Promise Rejection (id: 3):
TypeError: window.open is not a function
TypeError: window.open is not a function
    at _callee2$ (http://localhost:8081/index.bundle?platform=ios&dev=true&minify=false&modulesOnly=false&runModule=true&app=org.reactjs.native.example.running-app-wax:112814:33)
    at tryCatch (http://localhost:8081/index.bundle?platform=ios&dev=true&minify=false&modulesOnly=false&runModule=true&app=org.reactjs.native.example.running-app-wax:23952:19)
    at Generator.invoke [as _invoke] (http://localhost:8081/index.bundle?platform=ios&dev=true&minify=false&modulesOnly=false&runModule=true&app=org.reactjs.native.example.running-app-wax:24122:24)
    at Generator.next (http://localhost:8081/index.bundle?platform=ios&dev=true&minify=false&modulesOnly=false&runModule=true&app=org.reactjs.native.example.running-app-wax:23994:23)
    at http://localhost:8081/index.bundle?platform=ios&dev=true&minify=false&modulesOnly=false&runModule=true&app=org.reactjs.native.example.running-app-wax:112763:69
    at tryCallTwo (http://localhost:8081/index.bundle?platform=ios&dev=true&minify=false&modulesOnly=false&runModule=true&app=org.reactjs.native.example.running-app-wax:28682:7)
    at doResolve (http://localhost:8081/index.bundle?platform=ios&dev=true&minify=false&modulesOnly=false&runModule=true&app=org.reactjs.native.example.running-app-wax:28846:15)
    at new Promise (http://localhost:8081/index.bundle?platform=ios&dev=true&minify=false&modulesOnly=false&runModule=true&app=org.reactjs.native.example.running-app-wax:28705:5)
    at __awaiter (http://localhost:8081/index.bundle?platform=ios&dev=true&minify=false&modulesOnly=false&runModule=true&app=org.reactjs.native.example.running-app-wax:112742:12)
    at WaxEventSource.openPopup (http://localhost:8081/index.bundle?platform=ios&dev=true&minify=false&modulesOnly=false&runModule=true&app=org.reactjs.native.example.running-app-wax:112807:16)

It seems that the line generating the error is this one

  const win = await window.open(url, "WaxPopup", "height=800,width=600");

It does not look like is a permission problem because the error point to a problem calling window.open, not sure if window would be a valid variable in React Native.

Any Ideas are welcome

Icaro
  • 14,585
  • 6
  • 60
  • 75
  • You could use inappbrowser: https://stackoverflow.com/a/52261726/4317945 – Gabe Apr 26 '22 at 10:34
  • Hey @Gabe I try InAppBrowser, for some reason the window does not close, I also try Linking, but also I cannot get the URL events and the window does not close – Icaro Apr 26 '22 at 19:55

0 Answers0