Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP

Loading…

Errors when using YUI and browserify #1672

Closed
siemiatj opened this Issue · 3 comments

3 participants

@siemiatj

When I've tried adding YUI via npm and build everything with browserify I got :

Error: module "stdio" not found from "/project/node_modules/yui/yui-nodejs/yui-nodejs.js"

After installing stdio module I was getting :

Error:  ENOENT, open 'tls' while resolving "tls" from file /project/node_modules/yui/node_modules/request/index.js

After googling and reading sources I've found that this particular error can be fixed with using browser-request instead of request module. So everything looked fine, but after building everything without errors and running my project I'm getting:

Error: process.binding is not supported

in my first file trying to incorporate YUI.

Here's my Gruntfile :
module.exports = function(grunt) {
grunt.loadNpmTasks('grunt-browserify');
grunt.loadNpmTasks('grunt-http-server');

// Project configuration.
grunt.initConfig({
  browserify: {
    dist: {
      files: {
        'build/app.js': ['src/app/**/*.js'],
        'build/app-ui.js': ['src/UI/*.js']
      },
      options: {}
    }
  },

  'http-server': {
    dev: {
      root: 'build',

      port: 1337,
      host: "127.0.0.1",

      cache: 0,
      showDir : true,
      autoIndex: true,
      defaultExt: "html",

      //wait or not for the process to finish
      runInBackground: false
    }
  },
});

grunt.registerTask('default', ['browserify']);
grunt.registerTask('run', ['http-server:dev']);

};

and packages.json :

{
  "devDependencies": {
    "grunt": "~0.4.2",
    "browserify": "~3.30.2",
    "grunt-browserify": "~1.3.1",
    "grunt-http-server": "0.0.4"
  },
  "dependencies": {
    "angular": "~1.2.10",
    "yui": "~3.15.0"
  }
}

Not sure if the last error is related to the previous, but any tips how to fix this appreciated.

@caridy
Owner

Hmm, interesting. The issue here is that npm pkg includes yui modules that are meant to be used on the server side only, like yui-nodejs, which patches yui to run on the server side. This is a difficult problem to solve. Ideally you could exclude all the nodejs specific modules when processing them using browserify.

@hojberg

@siemiatj i'm running into this issue as well - did you ever find a good solution?

@caridy
Owner

no, this is not feasible with the yui infrastructure, sorry.

@caridy caridy closed this
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Something went wrong with that request. Please try again.