NativeScript, Apollo and apollo-link-prismic - Can't resolve 'encoding'

I am using NativeScript Vue, and using GraphQL to retrieve the Prismic data. This does not happen with vanilla Vue. I have been trying all sorts of things over the past two weeks, really ripping my hair out. I haven’t been able to test any other GraphQL servers. It fails after:

file: node_modules/readable-stream/lib/_stream_writable.js:57:80: JS ERROR TypeError: undefined is not an object (evaluating 'global.process.version.slice')

I also receive a warning, specifically when using apollo-link-prismic.

WARNING in ../node_modules/node-fetch/lib/index.es.js
Module not found: Error: Can't resolve 'encoding' in '/Users/jameshome/Documents/projects/native/bwapp/node_modules/node-fetch/lib'
 @ ../node_modules/node-fetch/lib/index.es.js
 @ ../node_modules/cross-fetch/dist/node-ponyfill.js
 @ ../node_modules/cross-fetch/dist/node-polyfill.js
 @ ../node_modules/prismic-javascript/dist/prismic-javascript.min.js
 @ ../node_modules/apollo-link-prismic/dist/apollo-link-prismic.min.js
 @ ./main.js

main.js

import Vue from 'nativescript-vue'
import App from './components/App'
import VueDevtools from 'nativescript-vue-devtools'
// import routes from "./routes";

import VueApollo from "vue-apollo";
import { ApolloClient } from 'apollo-client'
import { PrismicLink } from "apollo-link-prismic";
import { InMemoryCache } from "apollo-cache-inmemory";

export const defaultClient = new ApolloClient({
  link: new PrismicLink({  uri: 'http://reponame.prismic.io/graphql'}),
  cache: new InMemoryCache()
})
Vue.use(VueApollo);

const apolloProvider = new VueApollo({
    defaultClient,
});


if(TNS_ENV !== 'production') {
  Vue.use(VueDevtools)
}
import store from './store'

// Prints Vue logs when --env.production is *NOT* set while building
Vue.config.silent = (TNS_ENV === 'production')


new Vue({
  el: '#app',
  store,
  apolloProvider,
  render: h => h('frame', [h(App)])
}).$start()

The full log can be found below:

jameshome@Tycho-MBP siteapp % tns run ios
Searching for devices...
Preparing project...
Bundling application for entryPath ./main...
File change detected. Starting incremental webpack compilation...

webpack is watching the files…

[BABEL] Note: The code generator has deoptimised the styling of /Users/jameshome/Documents/projects/native/siteapp/node_modules/@vue/devtools/build/backend.js as it exceeds the max of 500KB.
Hash: 500927397492203fe81f
Version: webpack 4.27.1
Time: 20536ms
Built at: 26/07/2020 21:10:36
                                            Asset       Size                                          Chunks             Chunk Names
               assets/images/NativeScript-Vue.png   8.22 KiB                                                  [emitted]
                                        bundle.js    366 KiB                                          bundle  [emitted]  bundle
                                     package.json  157 bytes                                                  [emitted]
                                       runtime.js   71.4 KiB                                         runtime  [emitted]  runtime
tns_modules/tns-core-modules/inspector_modules.js  696 bytes  tns_modules/tns-core-modules/inspector_modules  [emitted]  tns_modules/tns-core-modules/inspector_modules
                                        vendor.js   14.2 MiB                                          vendor  [emitted]  vendor
Entrypoint bundle = runtime.js vendor.js bundle.js
Entrypoint tns_modules/tns-core-modules/inspector_modules = runtime.js vendor.js tns_modules/tns-core-modules/inspector_modules.js
[./ sync ^\.\/app\.(css|scss|less|sass)$] . sync nonrecursive ^\.\/app\.(css|scss|less|sass)$ 175 bytes {bundle} [built]
[./ sync recursive (?<!\bApp_Resources\b.*)(?<!\.\/\btests\b\/.*?)\.(xml|css|js|kt|(?<!\.d\.)ts|(?<!\b_[\w-]*\.)scss)$] . sync (?<!\bApp_Resources\b.*)(?<!\.\/\btests\b\/.*?)\.(xml|css|js|kt|(?<!\.d\.)ts|(?<!\b_[\w-]*\.)scss)$ 204 bytes {bundle} [built]
[./app.scss] 120 KiB {bundle} [optional] [built]
[./main.js] 2.26 KiB {bundle} [built]
[./package.json] 138 bytes {bundle} {tns_modules/tns-core-modules/inspector_modules} [optional] [built]
[./store.js] 1.25 KiB {bundle} [built]
    + 447 hidden modules

WARNING in ../node_modules/node-fetch/lib/index.es.js
Module not found: Error: Can't resolve 'encoding' in '/Users/jameshome/Documents/projects/native/siteapp/node_modules/node-fetch/lib'
 @ ../node_modules/node-fetch/lib/index.es.js
 @ ../node_modules/cross-fetch/dist/node-ponyfill.js
 @ ../node_modules/cross-fetch/dist/node-polyfill.js
 @ ../node_modules/prismic-javascript/dist/prismic-javascript.min.js
 @ ../node_modules/apollo-link-prismic/dist/apollo-link-prismic.min.js
 @ ./main.js
Webpack compilation complete. Watching for file changes.
Webpack build done!
Installing pods...
Analyzing dependencies
Pre-downloading: `Socket.IO-Client-Swift` from `https://github.com/triniwiz/socket.io-client-swift.git`
Pre-downloading: `Toast-Swift` from `https://github.com/triniwiz/Toast-Swift.git`
Downloading dependencies
Installing MDFInternationalization (2.0.0)
Installing MaterialComponents (94.5.0)
Installing Socket.IO-Client-Swift (15.1.0)
Installing Starscream (3.1.1)
Installing Toast-Swift (5.0.1)
Generating Pods project
Integrating client project

[!] Please close any current Xcode sessions and use `siteapp.xcworkspace` for this project from now on.
Pod installation complete! There are 3 dependencies from the Podfile and 5 total pods installed.
Project successfully prepared (ios)
Building project...
Xcode build...
/Users/jameshome/Documents/projects/native/siteapp/platforms/ios/Pods/Starscream/Sources/Starscream/Compression.swift:59:25: warning: 'withUnsafeBytes' is deprecated: use `withUnsafeBytes<R>(_: (UnsafeRawBufferPointer) throws -> R) rethrows -> R` instead
        return try data.withUnsafeBytes { (bytes:UnsafePointer<UInt8>) -> Data in
                        ^
/Users/jameshome/Documents/projects/native/siteapp/platforms/ios/Pods/Starscream/Sources/Starscream/Compression.swift:83:29: warning: initialization of 'UnsafeMutablePointer<UInt8>' results in a dangling pointer
            strm.next_out = UnsafeMutablePointer<UInt8>(&buffer)
                            ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
/Users/jameshome/Documents/projects/native/siteapp/platforms/ios/Pods/Starscream/Sources/Starscream/Compression.swift:83:57: note: implicit argument conversion from '[UInt8]' to 'UnsafeMutablePointer<UInt8>' produces a pointer valid only for the duration of the call to 'init(_:)'
            strm.next_out = UnsafeMutablePointer<UInt8>(&buffer)
                                                        ^~~~~~~
/Users/jameshome/Documents/projects/native/siteapp/platforms/ios/Pods/Starscream/Sources/Starscream/Compression.swift:83:57: note: use the 'withUnsafeMutableBufferPointer' method on Array in order to explicitly convert argument to buffer pointer valid for a defined scope
            strm.next_out = UnsafeMutablePointer<UInt8>(&buffer)
                                                        ^
/Users/jameshome/Documents/projects/native/siteapp/platforms/ios/Pods/Starscream/Sources/Starscream/Compression.swift:145:33: warning: initialization of 'UnsafeMutablePointer<UInt8>' results in a dangling pointer
                strm.next_out = UnsafeMutablePointer<UInt8>(&buffer)
                                ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
/Users/jameshome/Documents/projects/native/siteapp/platforms/ios/Pods/Starscream/Sources/Starscream/Compression.swift:145:61: note: implicit argument conversion from '[UInt8]' to 'UnsafeMutablePointer<UInt8>' produces a pointer valid only for the duration of the call to 'init(_:)'
                strm.next_out = UnsafeMutablePointer<UInt8>(&buffer)
                                                            ^~~~~~~
/Users/jameshome/Documents/projects/native/siteapp/platforms/ios/Pods/Starscream/Sources/Starscream/Compression.swift:145:61: note: use the 'withUnsafeMutableBufferPointer' method on Array in order to explicitly convert argument to buffer pointer valid for a defined scope
                strm.next_out = UnsafeMutablePointer<UInt8>(&buffer)
                                                            ^
/Users/jameshome/Documents/projects/native/siteapp/platforms/ios/Pods/Starscream/Sources/Starscream/Compression.swift:140:14: warning: 'withUnsafeBytes' is deprecated: use `withUnsafeBytes<R>(_: (UnsafeRawBufferPointer) throws -> R) rethrows -> R` instead
        data.withUnsafeBytes { (ptr:UnsafePointer<UInt8>) -> Void in
             ^
/Users/jameshome/Documents/projects/native/siteapp/platforms/ios/Pods/Starscream/Sources/Starscream/WebSocket.swift:282:30: warning: 'withUnsafeMutableBytes' is deprecated: use `withUnsafeMutableBytes<R>(_: (UnsafeMutableRawBufferPointer) throws -> R) rethrows -> R` instead
            let _ = peerName.withUnsafeMutableBytes { (peerNamePtr: UnsafeMutablePointer<Int8>) in
                             ^
/Users/jameshome/Documents/projects/native/siteapp/platforms/ios/Pods/Starscream/Sources/Starscream/WebSocket.swift:1326:14: warning: 'withUnsafeBytes' is deprecated: use `withUnsafeBytes<R>(_: (UnsafeRawBufferPointer) throws -> R) rethrows -> R` instead
        data.withUnsafeBytes { _ = CC_SHA1($0, CC_LONG(data.count), &digest) }
             ^
/Users/jameshome/Documents/projects/native/siteapp/platforms/ios/Pods/Starscream/Sources/Starscream/WebSocket.swift:1327:16: warning: 'init(bytes:)' is deprecated: use `init(_:)` instead
        return Data(bytes: digest).base64EncodedString()
               ^
/Users/jameshome/Documents/projects/native/siteapp/platforms/ios/Pods/Starscream/Sources/Starscream/Compression.swift:59:25: warning: 'withUnsafeBytes' is deprecated: use `withUnsafeBytes<R>(_: (UnsafeRawBufferPointer) throws -> R) rethrows -> R` instead
        return try data.withUnsafeBytes { (bytes:UnsafePointer<UInt8>) -> Data in
                        ^
/Users/jameshome/Documents/projects/native/siteapp/platforms/ios/Pods/Starscream/Sources/Starscream/Compression.swift:83:29: warning: initialization of 'UnsafeMutablePointer<UInt8>' results in a dangling pointer
            strm.next_out = UnsafeMutablePointer<UInt8>(&buffer)
                            ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
/Users/jameshome/Documents/projects/native/siteapp/platforms/ios/Pods/Starscream/Sources/Starscream/Compression.swift:83:57: note: implicit argument conversion from '[UInt8]' to 'UnsafeMutablePointer<UInt8>' produces a pointer valid only for the duration of the call to 'init(_:)'
            strm.next_out = UnsafeMutablePointer<UInt8>(&buffer)
                                                        ^~~~~~~
/Users/jameshome/Documents/projects/native/siteapp/platforms/ios/Pods/Starscream/Sources/Starscream/Compression.swift:83:57: note: use the 'withUnsafeMutableBufferPointer' method on Array in order to explicitly convert argument to buffer pointer valid for a defined scope
            strm.next_out = UnsafeMutablePointer<UInt8>(&buffer)
                                                        ^
/Users/jameshome/Documents/projects/native/siteapp/platforms/ios/Pods/Starscream/Sources/Starscream/Compression.swift:145:33: warning: initialization of 'UnsafeMutablePointer<UInt8>' results in a dangling pointer
                strm.next_out = UnsafeMutablePointer<UInt8>(&buffer)
                                ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
/Users/jameshome/Documents/projects/native/siteapp/platforms/ios/Pods/Starscream/Sources/Starscream/Compression.swift:145:61: note: implicit argument conversion from '[UInt8]' to 'UnsafeMutablePointer<UInt8>' produces a pointer valid only for the duration of the call to 'init(_:)'
                strm.next_out = UnsafeMutablePointer<UInt8>(&buffer)
                                                            ^~~~~~~
/Users/jameshome/Documents/projects/native/siteapp/platforms/ios/Pods/Starscream/Sources/Starscream/Compression.swift:145:61: note: use the 'withUnsafeMutableBufferPointer' method on Array in order to explicitly convert argument to buffer pointer valid for a defined scope
                strm.next_out = UnsafeMutablePointer<UInt8>(&buffer)
                                                            ^
/Users/jameshome/Documents/projects/native/siteapp/platforms/ios/Pods/Starscream/Sources/Starscream/Compression.swift:140:14: warning: 'withUnsafeBytes' is deprecated: use `withUnsafeBytes<R>(_: (UnsafeRawBufferPointer) throws -> R) rethrows -> R` instead
        data.withUnsafeBytes { (ptr:UnsafePointer<UInt8>) -> Void in
             ^
/Users/jameshome/Documents/projects/native/siteapp/platforms/ios/Pods/Starscream/Sources/Starscream/WebSocket.swift:282:30: warning: 'withUnsafeMutableBytes' is deprecated: use `withUnsafeMutableBytes<R>(_: (UnsafeMutableRawBufferPointer) throws -> R) rethrows -> R` instead
            let _ = peerName.withUnsafeMutableBytes { (peerNamePtr: UnsafeMutablePointer<Int8>) in
                             ^
/Users/jameshome/Documents/projects/native/siteapp/platforms/ios/Pods/Starscream/Sources/Starscream/WebSocket.swift:1326:14: warning: 'withUnsafeBytes' is deprecated: use `withUnsafeBytes<R>(_: (UnsafeRawBufferPointer) throws -> R) rethrows -> R` instead
        data.withUnsafeBytes { _ = CC_SHA1($0, CC_LONG(data.count), &digest) }
             ^
/Users/jameshome/Documents/projects/native/siteapp/platforms/ios/Pods/Starscream/Sources/Starscream/WebSocket.swift:1327:16: warning: 'init(bytes:)' is deprecated: use `init(_:)` instead
        return Data(bytes: digest).base64EncodedString()
               ^
/* com.apple.actool.document.warnings */
/Users/jameshome/Documents/projects/native/siteapp/platforms/ios/siteapp/Resources/Assets.xcassets:./LaunchImage.launchimage: warning: Launch images are deprecated in iOS 13.0. Use a launch storyboard or XIB instead.
/* com.apple.actool.document.notices */
/Users/jameshome/Documents/projects/native/siteapp/platforms/ios/siteapp/Resources/Assets.xcassets:./AppIcon.appiconset/[][ipad][76x76][][][1x][][]: notice: 76x76@1x app icons only apply to iPad apps targeting releases of iOS prior to 10.0.
/Users/jameshome/Documents/projects/native/siteapp/platforms/ios/siteapp/Resources/Assets.xcassets:./LaunchImage.launchimage/[iphone][retina4][2x][portrait][full-screen][]: notice: This launch image only applies to iOS 6.x and prior but the minimum deployment is 7.0 or later.
/* com.apple.actool.compilation-results */
/Users/jameshome/Documents/projects/native/siteapp/platforms/ios/build/Debug-iphonesimulator/siteapp.app/AppIcon20x20@2x.png
/Users/jameshome/Documents/projects/native/siteapp/platforms/ios/build/Debug-iphonesimulator/siteapp.app/AppIcon20x20@3x.png
/Users/jameshome/Documents/projects/native/siteapp/platforms/ios/build/Debug-iphonesimulator/siteapp.app/AppIcon29x29.png
/Users/jameshome/Documents/projects/native/siteapp/platforms/ios/build/Debug-iphonesimulator/siteapp.app/AppIcon29x29@2x.png
/Users/jameshome/Documents/projects/native/siteapp/platforms/ios/build/Debug-iphonesimulator/siteapp.app/AppIcon29x29@3x.png
/Users/jameshome/Documents/projects/native/siteapp/platforms/ios/build/Debug-iphonesimulator/siteapp.app/AppIcon40x40@2x.png
/Users/jameshome/Documents/projects/native/siteapp/platforms/ios/build/Debug-iphonesimulator/siteapp.app/AppIcon40x40@3x.png
/Users/jameshome/Documents/projects/native/siteapp/platforms/ios/build/Debug-iphonesimulator/siteapp.app/AppIcon60x60@2x.png
/Users/jameshome/Documents/projects/native/siteapp/platforms/ios/build/Debug-iphonesimulator/siteapp.app/AppIcon60x60@3x.png
/Users/jameshome/Documents/projects/native/siteapp/platforms/ios/build/Debug-iphonesimulator/siteapp.app/AppIcon20x20~ipad.png
/Users/jameshome/Documents/projects/native/siteapp/platforms/ios/build/Debug-iphonesimulator/siteapp.app/AppIcon20x20@2x~ipad.png
/Users/jameshome/Documents/projects/native/siteapp/platforms/ios/build/Debug-iphonesimulator/siteapp.app/AppIcon29x29~ipad.png
/Users/jameshome/Documents/projects/native/siteapp/platforms/ios/build/Debug-iphonesimulator/siteapp.app/AppIcon29x29@2x~ipad.png
/Users/jameshome/Documents/projects/native/siteapp/platforms/ios/build/Debug-iphonesimulator/siteapp.app/AppIcon40x40~ipad.png
/Users/jameshome/Documents/projects/native/siteapp/platforms/ios/build/Debug-iphonesimulator/siteapp.app/AppIcon40x40@2x~ipad.png
/Users/jameshome/Documents/projects/native/siteapp/platforms/ios/build/Debug-iphonesimulator/siteapp.app/AppIcon76x76~ipad.png
/Users/jameshome/Documents/projects/native/siteapp/platforms/ios/build/Debug-iphonesimulator/siteapp.app/AppIcon76x76@2x~ipad.png
/Users/jameshome/Documents/projects/native/siteapp/platforms/ios/build/Debug-iphonesimulator/siteapp.app/AppIcon83.5x83.5@2x~ipad.png
/Users/jameshome/Documents/projects/native/siteapp/platforms/ios/build/Debug-iphonesimulator/siteapp.app/LaunchImage-1200-Portrait-2688h@3x.png
/Users/jameshome/Documents/projects/native/siteapp/platforms/ios/build/Debug-iphonesimulator/siteapp.app/LaunchImage-1200-Landscape-2688h@3x.png
/Users/jameshome/Documents/projects/native/siteapp/platforms/ios/build/Debug-iphonesimulator/siteapp.app/LaunchImage-1200-Portrait-1792h@2x.png
/Users/jameshome/Documents/projects/native/siteapp/platforms/ios/build/Debug-iphonesimulator/siteapp.app/LaunchImage-1200-Landscape-1792h@2x.png
/Users/jameshome/Documents/projects/native/siteapp/platforms/ios/build/Debug-iphonesimulator/siteapp.app/LaunchImage-1100-Portrait-2436h@3x.png
/Users/jameshome/Documents/projects/native/siteapp/platforms/ios/build/Debug-iphonesimulator/siteapp.app/LaunchImage-1100-Landscape-2436h@3x.png
/Users/jameshome/Documents/projects/native/siteapp/platforms/ios/build/Debug-iphonesimulator/siteapp.app/LaunchImage-800-Portrait-736h@3x.png
/Users/jameshome/Documents/projects/native/siteapp/platforms/ios/build/Debug-iphonesimulator/siteapp.app/LaunchImage-800-Landscape-736h@3x.png
/Users/jameshome/Documents/projects/native/siteapp/platforms/ios/build/Debug-iphonesimulator/siteapp.app/LaunchImage-800-667h@2x.png
/Users/jameshome/Documents/projects/native/siteapp/platforms/ios/build/Debug-iphonesimulator/siteapp.app/LaunchImage-700@2x.png
/Users/jameshome/Documents/projects/native/siteapp/platforms/ios/build/Debug-iphonesimulator/siteapp.app/LaunchImage-700-568h@2x.png
/Users/jameshome/Documents/projects/native/siteapp/platforms/ios/build/Debug-iphonesimulator/siteapp.app/LaunchImage-700-Portrait~ipad.png
/Users/jameshome/Documents/projects/native/siteapp/platforms/ios/build/Debug-iphonesimulator/siteapp.app/LaunchImage-700-Landscape~ipad.png
/Users/jameshome/Documents/projects/native/siteapp/platforms/ios/build/Debug-iphonesimulator/siteapp.app/LaunchImage-700-Portrait@2x~ipad.png
/Users/jameshome/Documents/projects/native/siteapp/platforms/ios/build/Debug-iphonesimulator/siteapp.app/LaunchImage-700-Landscape@2x~ipad.png
/Users/jameshome/Documents/projects/native/siteapp/platforms/ios/build/Debug-iphonesimulator/siteapp.app/LaunchImage.png
/Users/jameshome/Documents/projects/native/siteapp/platforms/ios/build/Debug-iphonesimulator/siteapp.app/LaunchImage@2x.png
/Users/jameshome/Documents/projects/native/siteapp/platforms/ios/build/Debug-iphonesimulator/siteapp.app/LaunchImage-568h@2x.png
/Users/jameshome/Documents/projects/native/siteapp/platforms/ios/build/Debug-iphonesimulator/siteapp.app/LaunchImage-Portrait~ipad.png
/Users/jameshome/Documents/projects/native/siteapp/platforms/ios/build/Debug-iphonesimulator/siteapp.app/LaunchImage-Landscape~ipad.png
/Users/jameshome/Documents/projects/native/siteapp/platforms/ios/build/Debug-iphonesimulator/siteapp.app/LaunchImage-Portrait@2x~ipad.png
/Users/jameshome/Documents/projects/native/siteapp/platforms/ios/build/Debug-iphonesimulator/siteapp.app/LaunchImage-Landscape@2x~ipad.png
/Users/jameshome/Documents/projects/native/siteapp/platforms/ios/build/Debug-iphonesimulator/siteapp.app/Assets.car
/Users/jameshome/Library/Developer/Xcode/DerivedData/siteapp-fsibcmjeksqupogpijoadfhiniox/Build/Intermediates.noindex/siteapp.build/Debug-iphonesimulator/siteapp.build/assetcatalog_generated_info.plist

warning: 'UILaunchImages' has been deprecated, use launch storyboards instead. (in target 'siteapp' from project 'siteapp')
note: Using new build system
note: Building targets in parallel
note: Planning build
note: Constructing build description
Project successfully built.
The build result is located at: /Users/jameshome/Documents/projects/native/siteapp/platforms/ios/build/Debug-iphonesimulator/siteapp.app
Installing on device C51D9233-F315-4B1F-A40D-B9910F695672...
Successfully installed on device with identifier 'C51D9233-F315-4B1F-A40D-B9910F695672'.
Successfully transferred all files on device C51D9233-F315-4B1F-A40D-B9910F695672.
Restarting application on device C51D9233-F315-4B1F-A40D-B9910F695672...
***** Fatal JavaScript exception - application has been terminated. *****
Native stack trace:
1   0x10e3be62e NativeScript::reportFatalErrorBeforeShutdown(JSC::ExecState*, JSC::Exception*, bool)
2   0x10e410524 -[TNSRuntime executeModule:referredBy:]
3   0x10dca70d3 main
4   0x1118a01fd start
5   0x1
JavaScript stack trace:
file: node_modules/readable-stream/lib/_stream_writable.js:57:80
at ../node_modules/readable-stream/lib/_stream_writable.js(file:///app/vendor.js:112458:34)
at __webpack_require__(file: app/webpack/bootstrap:750:0)
at fn(file: app/webpack/bootstrap:120:0)
at ../node_modules/readable-stream/readable.js(file: node_modules/readable-stream/readable.js:15:29)
at __webpack_require__(file: app/webpack/bootstrap:750:0)
at fn(file: app/webpack/bootstrap:120:0)
at ../node_modules/stream-browserify/index.js(file: node_modules/stream-browserify/index.js:28:26)
at __webpack_require__(file: app/webpack/bootstrap:750:0)
at fn(file: app/webpack/bootstrap:120:0)
at file: node_modules/node-fetch/lib/index.es.js:132:23
at ../node_modules/node-fetch/lib/index.es.js(file:///app/vendor.js:99406:34)
at __webpack_require__(file: app/webpack/bootstrap:750:0)
at fn(file: app/webpack/bootstrap:120:0)
at ../node_modules/cross-fetch/dist/node-ponyfill.js(file: node_modules/cross-fetch/dist/node-ponyfill.js:1:24)
at __webpack_require__(file: app/webpack/bootstrap:750:0)
at fn(file: app/webpack/bootstrap:120:0)
at file: node_modules/cross-fetch/dist/node-polyfill.js:1:24
at ../node_modules/cross-fetch/dist/node-polyf<…>
JavaScript error:
file: node_modules/readable-stream/lib/_stream_writable.js:57:80: JS ERROR TypeError: undefined is not an object (evaluating 'global.process.version.slice')
(CoreFoundation) *** Terminating app due to uncaught exception 'NativeScript encountered a fatal error: TypeError: undefined is not an object (evaluating 'global.process.version.slice')
at
file: node_modules/readable-stream/lib/_stream_writable.js:57:80
at ../node_modules/readable-stream/lib/_stream_writable.js(file:///app/vendor.js:112458:34)
at __webpack_require__(file: app/webpack/bootstrap:750:0)
at fn(file: app/webpack/bootstrap:120:0)
at ../node_modules/readable-stream/readable.js(file: node_modules/readable-stream/readable.js:15:29)
at __webpack_require__(file: app/webpack/bootstrap:750:0)
at fn(file: app/webpack/bootstrap:120:0)
at ../node_modules/stream-browserify/index.js(file: node_modules/stream-browserify/index.js:28:26)
at __webpack_require__(file: app/webpack/bootstrap:750:0)
at fn(file: app/webpack/bootstrap:120:0)
at file: node_modules/node-fetch/lib/index.es.js:132:23
at ../node_modules/node-fetch/lib/index.es.js(file:///app/vendor.js:99406:34)
at __webpack_require__(file: app/webpack/bootstrap:750:0)
at fn(file: app/webpack/bootstrap:120:0)
at ../node_modules/cross-fetch/dist/node-ponyfill.js(file: node_modules/cross-fetch/dist/node-ponyfill.js:1:0<…>
NativeScript caught signal 6.
Native Stack:
1   0x10e40f171 sig_handler(int)
2   0x111c8f5fd _sigtramp
3   0x10e3230b8
4   0x1119c9b7c abort
5   0x1116ea858 abort_message
6   0x1116dbcbf demangling_unexpected_handler()
7   0x110c12c0b _objc_terminate()
8   0x1116e9c87 std::__terminate(void (*)())
9   0x1116ec40b __cxa_get_exception_ptr
10  0x1116ec3d2 __cxxabiv1::exception_cleanup_func(_Unwind_Reason_Code, _Unwind_Exception*)
11  0x110c12ad6 _objc_exception_destructor(void*)
12  0x10e3beb6f NativeScript::reportFatalErrorBeforeShutdown(JSC::ExecState*, JSC::Exception*, bool)
13  0x10e410524 -[TNSRuntime executeModule:referredBy:]
14  0x10dca70d3 main
15  0x1118a01fd start
16  0x1
JS Stack:
NativeScript debugger was not able to get inspector socket port on device C51D9233-F315-4B1F-A40D-B9910F695672 for application site.ns.app.
Successfully synced application site.ns.app on device C51D9233-F315-4B1F-A40D-B9910F695672.
≈≈≈

Any help would be most appreciated. I could give access to the codebase it is helpful (but there’s not much to it).

1 Like

Hello James, the error seems like it could come from a variety of different reasons. It seems like it’s an error coming from Node while trying to read: global.process.version.slice, there are threads online that talk about similar errors, like this one:

And about the apollo-link-prismic package, what was the behaviour of the application before it started to throw these warnings?

Thanks for the reply. I came across this issue too and I seem to remember I attempted the resolution but it did not work. I ended up using an alternative API because I had to move on which did work.

I tried to use apollo-link-prismic with a regular vuejs setup and it worked flawlessly but not with nativescript-vue. Might be something on nativescript-vue's end but I don’t know.

This issue has been closed due to inactivity.