Notalib / nativescript-webview-ext

Nativescript plugin with extended WebView functionality
Apache License 2.0
76 stars 37 forks source link

[iOS] crash: 'Uncaught ReferenceError: fs is not defined' #104

Closed tralves closed 3 years ago

tralves commented 3 years ago

Which platform(s) does your issue occur on?

Please, provide the following version numbers that your issue occurs with:

Please, tell us how to recreate the issue in as much detail as possible.

Create a new {N}-Vue app, add plugin, run on iOS.

Console output:

***** Fatal JavaScript exception - application has been terminated. *****
NativeScript encountered a fatal error: Uncaught ReferenceError: fs is not defined
at
_loadData(file: app/webview-ext.ios.ts:200:35)
at [src:setNative](file: app/webview-ext-common.ts:830:17)

The error happens because there is no fs. This seems pretty easy to fix. In fact, this plugin is properly updated here .

I will try to fix and PR soon, but for now I find it very weird that I am the first one to find this error :P. It should happen in iOS every time. Am I missing something to make fs work?

tralves commented 3 years ago

If anyone needs these fixes while the PR isn't merged, you can use my compiled lib like so

package.json:

"@nota/nativescript-webview-ext": "https://github.com/tralves/nativescript-webview-ext/raw/master/dist/nota-nativescript-webview-ext-7.0.3.tgz",