tsouza / yajs

Yet Another JSON Streaming Tool
MIT License
11 stars 4 forks source link

ES5 compatibility is broken #3

Closed sastraxi closed 6 years ago

sastraxi commented 6 years ago

After yarn add yajson-stream in our non-typescript (babel) project, we got the following error when trying to use:

module.js:540
    throw err;
    ^

Error: Cannot find module 'yajson-stream'
    at Function.Module._resolveFilename (module.js:538:15)
    at Function.Module._load (module.js:468:25)
    at Module.require (module.js:587:17)
    at require (internal/module.js:11:18)
    at Object.<anonymous> (.../aggregator/src/data/parse.js:3:14)
    at Module._compile (module.js:643:30)
    at loader (.../node_modules/babel-register/lib/node.js:144:5)
    at Object.require.extensions.(anonymous function) [as .js] (.../node_modules/babel-register/lib/node.js:154:7)
    at Module.load (module.js:556:32)
    at tryModuleLoad (module.js:499:12)

I think this is because main.js is not getting included in the dist/ folder. When I change main.js to main.ts, it is detected by gulp and properly packaged -- I think this is the fix, but I'm not too sure.

tsouza commented 6 years ago

Fixed in https://github.com/tsouza/yajs/commit/0a08caf8cd724e6dbe925fb179fbb8b1b7423e62