From 1f90c9564915255e2a5480d00a46288992ec6fb3 Mon Sep 17 00:00:00 2001 From: Benjamin Vincent Date: Sat, 10 Oct 2020 10:37:01 -0400 Subject: [PATCH] Class constructor cannot be invoked without 'new' > obs-midi-docs@1.0.0 build ${HOME}/.config/obs-studio/plugin_config/obs-midi/docs > npm run comments && npm run docs > obs-midi-docs@1.0.0 comments ${HOME}/.config/obs-studio/plugin_config/obs-midi/docs > node ./comments.js ${HOME}/.config/obs-studio/plugin_config/obs-midi/docs/comments.js:17 response = response.concat(parseComments(f)); ^ TypeError: Class constructor Comments cannot be invoked without 'new' at ${HOME}/.config/obs-studio/plugin_config/obs-midi/docs/comments.js:17:36 at Array.forEach () at parseFiles (${HOME}/.config/obs-studio/plugin_config/obs-midi/docs/comments.js:15:11) at Object. (${HOME}/.config/obs-studio/plugin_config/obs-midi/docs/comments.js:98:34) at Module._compile (internal/modules/cjs/loader.js:1251:30) at Object.Module._extensions..js (internal/modules/cjs/loader.js:1272:10) at Module.load (internal/modules/cjs/loader.js:1100:32) at Function.Module._load (internal/modules/cjs/loader.js:962:14) at Function.executeUserEntryPoint [as runMain] (internal/modules/run_main.js:72:12) at internal/main/run_main_module.js:17:47 npm ERR! code ELIFECYCLE npm ERR! errno 1 npm ERR! obs-midi-docs@1.0.0 comments: `node ./comments.js` npm ERR! Exit status 1 npm ERR! npm ERR! Failed at the obs-midi-docs@1.0.0 comments script. npm ERR! This is probably not a problem with npm. There is likely additional logging output above. npm ERR! A complete log of this run can be found in: npm ERR! ${HOME}/.npm/_logs/2020-10-10T14_32_06_217Z-debug.log npm ERR! code ELIFECYCLE npm ERR! errno 1 npm ERR! obs-midi-docs@1.0.0 build: `npm run comments && npm run docs` npm ERR! Exit status 1 npm ERR! npm ERR! Failed at the obs-midi-docs@1.0.0 build script. npm ERR! This is probably not a problem with npm. There is likely additional logging output above. npm ERR! A complete log of this run can be found in: npm ERR! ${HOME}/.npm/_logs/2020-10-10T14_32_06_250Z-debug.log --- docs/comments.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/docs/comments.js b/docs/comments.js index c396c5da..1497fbf3 100644 --- a/docs/comments.js +++ b/docs/comments.js @@ -1,7 +1,7 @@ const fs = require('fs'); const path = require('path'); const glob = require('glob'); -const parseComments = require('parse-comments'); +const ParseComments = require('parse-comments'); const config = require('./config.json'); /** @@ -14,7 +14,7 @@ const parseFiles = files => { let response = []; files.forEach(file => { const f = fs.readFileSync(file, 'utf8').toString(); - response = response.concat(parseComments(f)); + response = response.concat(new ParseComments(f)); }); return response;