LucyBot-Inc / api-spec-converter

Convert API descriptions between popular formats such as OpenAPI(fka Swagger), RAML, API Blueprint, WADL, etc.
https://lucybot-inc.github.io/api-spec-converter/
MIT License
1.11k stars 180 forks source link

Error in /var/www/node/node_modules/drafter.js/lib/drafter.nomem.js:1 #374

Open le-viet-anh-0001 opened 11 months ago

le-viet-anh-0001 commented 11 months ago

Our server crashes periodically everyday, every hour, and this is the log right before a crash:

((function(f){if(typeof exports==="object"&&typeof module!=="undefined"){module.exports=f()}else if(typeof define==="function"&&define.amd){define([],f)}else{var g;if(typeof window!=="undefined"){g=window}else if(typeof global!=="undefined"){g=global}else if(typeof self!=="undefined"){g=self}else{g=this}g.drafter=f()}}))((function(){var module;var Module;if(!Module){Module={}}Module["ready"]=false;Module["log"]=(function(text){console.log("drafter.js: "+text)});Module["logErr"]=(function(text){console.error("drafter.js: "+text)});Module["onRuntimeInitialized"]=(function(){this.ready=true});var Module;if(!Module)Module=(typeof Module!=="undefined"?Module:null)||{};var moduleOverrides={};for(var key in Module){if(Module.hasOwnProperty(key)){moduleOverrides[key]=Module[key]}}var ENVIRONMENT_IS_WEB=false;var ENVIRONMENT_IS_WORKER=false;var ENVIRONMENT_IS_NODE=false;var ENVIRONMENT_IS_SHELL=false;if(Module["ENVIRONMENT"]){if(Module["ENVIRONMENT"]==="WEB"){ENVIRONMENT_IS_WEB=true}else if(Module["ENVIRONMENT"]==="WORKER"){ENVIRONMENT_IS_WORKER=true}else if(Module["ENVIRONMENT"]==="NODE"){ENVIRONMENT_IS_NODE=true}else if(Module["ENVIRONMENT"]==="SHELL"){ENVIRONMENT_IS_SHELL=true}else{throw new Error("The provided Module['ENVIRONMENT'] value is not valid. It must be one of: WEB|WORKER|NODE|SHELL.")}}else{ENVIRONMENT_IS_WEB=typeof window==="object";ENVIRONMENT_IS_WORKER=typeof importScripts==="function";ENVIRONMENT_IS_NODE=typeof process==="object"&&typeof 

We really do not know what the cause is. Any suggestions would be appreciated!

mitchellwarr commented 8 months ago

Try adding this to your package.json. This fixed it for me

{
  "overrides": {
    "api-spec-converter": {
      "drafter.js": "3.2.0"
    }
  }
}
mitchellwarr commented 8 months ago

If this works for you too, then I think this package needs to have its dependancies updated