nativescript-nodeify icon indicating copy to clipboard operation
nativescript-nodeify copied to clipboard

Node package nats not working with nodeify

Open GrempelsGabriel opened this issue 5 years ago • 1 comments

Hi, i can't make npm package nats to work with nativescript nodeify. Thanks.

GrempelsGabriel avatar Jul 24 '19 09:07 GrempelsGabriel

How to reproduce the error:

  1. Create new project with nativescript and vue
  2. Add nativescript nodeify
  3. Add missing packages from node net and tls
  4. Add nativescript-randombytes

Make nativescript-randombytes accessible globally:

  1. Create new js file in project with this line: module.exports.randomBytes = require('nativescript-randombytes')
  2. Add to webpack.config.js in plugins configuration: new webpack.ProvidePlugin({ crypto: resolve(__dirname, 'path to file.js') });
  3. Add to webpack.config.js in resolve.alias configuration: 'crypto': resolve(__dirname, 'path to file.js')

Add the following under node config options in webpack.config.js: "net": 'mock'

Add the following under resolve config options in webpack.config.js: aliasFields: ['browser']

Now i get the following error: Cannot read property 'SetNoDelay' of undefined

I've tried to clean project platform/android folder, hooks and node_modules but i get the same error. Thanks.

GrempelsGabriel avatar Jul 24 '19 11:07 GrempelsGabriel