You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
We are using the mongoose-gridfs module, that has a dependency on lykmapipo/common. This version includes parse-ms with the following syntax in package.json: "parse-ms": ">=2.1.0"
Today - parse-me introduced version 3.0.0 of their code which breaks in index.js of common because they now require you to use the import command instead of the require command.
To stay compatible for other programs that depend on mongoose-gridfs and the like, if package.json instead used
"parse-ms": "2.1.0" this would not be a problem anymore.
Using node 12.6.0 produces the following call stack:
export default function parseMilliseconds(milliseconds) {
^^^^^^
SyntaxError: Unexpected token export
at Module._compile (internal/modules/cjs/loader.js:720:23)
at Object.Module._extensions..js (internal/modules/cjs/loader.js:787:10)
at Module.load (internal/modules/cjs/loader.js:643:32)
at Function.Module._load (internal/modules/cjs/loader.js:556:12)
at Module.require (internal/modules/cjs/loader.js:683:19)
at require (internal/modules/cjs/helpers.js:16:16)
at Object. (/opt/subtask/node_modules/@lykmapipo/common/lib/index.js:18:27)
at Module._compile (internal/modules/cjs/loader.js:776:30)
at Object.Module._extensions..js (internal/modules/cjs/loader.js:787:10)
at Module.load (internal/modules/cjs/loader.js:643:32)
at Function.Module._load (internal/modules/cjs/loader.js:556:12)
at Module.require (internal/modules/cjs/loader.js:683:19)
at require (internal/modules/cjs/helpers.js:16:16)
at Object. (/opt/subtask/node_modules/@lykmapipo/mongoose-common/index.js:31:47)
at Module._compile (internal/modules/cjs/loader.js:776:30)
at Object.Module._extensions..js (internal/modules/cjs/loader.js:787:10)
at Module.load (internal/modules/cjs/loader.js:643:32)
at Function.Module._load (internal/modules/cjs/loader.js:556:12)
at Module.require (internal/modules/cjs/loader.js:683:19)
at require (internal/modules/cjs/helpers.js:16:16)
at Object. (/opt/subtask/node_modules/mongoose-gridfs/lib/schema.js:6:41)
at Module._compile (internal/modules/cjs/loader.js:776:30)
Using node 13.2.0 produces the following call stack:
(node:259) Warning: require() of ES modules is not supported.
require() of /opt/subtask/node_modules/parse-ms/index.js from /opt/subtask/node_modules/@lykmapipo/common/lib/index.js is an ES module file as it is a .js file whose nearest parent package.json contains "type": "module" which defines all .js files in that package scope as ES modules.
Instead rename /opt/subtask/node_modules/parse-ms/index.js to end in .cjs, change the requiring code to use import(), or remove "type": "module" from /opt/subtask/node_modules/parse-ms/package.json.
internal/modules/cjs/loader.js:1156
throw new ERR_REQUIRE_ESM(filename);
^
Error [ERR_REQUIRE_ESM]: Must use import to load ES Module: /opt/subtask/node_modules/parse-ms/index.js
at Object.Module._extensions..js (internal/modules/cjs/loader.js:1156:13)
at Module.load (internal/modules/cjs/loader.js:976:32)
at Function.Module._load (internal/modules/cjs/loader.js:884:14)
at Module.require (internal/modules/cjs/loader.js:1016:19)
at require (internal/modules/cjs/helpers.js:69:18)
at Object. (/opt/subtask/node_modules/@lykmapipo/common/lib/index.js:18:27)
at Module._compile (internal/modules/cjs/loader.js:1121:30)
at Object.Module._extensions..js (internal/modules/cjs/loader.js:1160:10)
at Module.load (internal/modules/cjs/loader.js:976:32)
at Function.Module._load (internal/modules/cjs/loader.js:884:14)
at Module.require (internal/modules/cjs/loader.js:1016:19)
at require (internal/modules/cjs/helpers.js:69:18)
at Object. (/opt/subtask/node_modules/@lykmapipo/mongoose-common/index.js:31:47)
at Module._compile (internal/modules/cjs/loader.js:1121:30)
at Object.Module._extensions..js (internal/modules/cjs/loader.js:1160:10)
at Module.load (internal/modules/cjs/loader.js:976:32) {
code: 'ERR_REQUIRE_ESM'
}
Thank you for your help.
The text was updated successfully, but these errors were encountered:
We are using the mongoose-gridfs module, that has a dependency on lykmapipo/common. This version includes parse-ms with the following syntax in package.json: "parse-ms": ">=2.1.0"
Today - parse-me introduced version 3.0.0 of their code which breaks in index.js of common because they now require you to use the import command instead of the require command.
To stay compatible for other programs that depend on mongoose-gridfs and the like, if package.json instead used
"parse-ms": "2.1.0" this would not be a problem anymore.
The following code reproduces the problem:
const mongooseGridFs = require('mongoose-gridfs');
package.json has
"mongoose-gridfs": "1.2.48"
Using node 12.6.0 produces the following call stack:
export default function parseMilliseconds(milliseconds) {
^^^^^^
SyntaxError: Unexpected token export
at Module._compile (internal/modules/cjs/loader.js:720:23)
at Object.Module._extensions..js (internal/modules/cjs/loader.js:787:10)
at Module.load (internal/modules/cjs/loader.js:643:32)
at Function.Module._load (internal/modules/cjs/loader.js:556:12)
at Module.require (internal/modules/cjs/loader.js:683:19)
at require (internal/modules/cjs/helpers.js:16:16)
at Object. (/opt/subtask/node_modules/@lykmapipo/common/lib/index.js:18:27)
at Module._compile (internal/modules/cjs/loader.js:776:30)
at Object.Module._extensions..js (internal/modules/cjs/loader.js:787:10)
at Module.load (internal/modules/cjs/loader.js:643:32)
at Function.Module._load (internal/modules/cjs/loader.js:556:12)
at Module.require (internal/modules/cjs/loader.js:683:19)
at require (internal/modules/cjs/helpers.js:16:16)
at Object. (/opt/subtask/node_modules/@lykmapipo/mongoose-common/index.js:31:47)
at Module._compile (internal/modules/cjs/loader.js:776:30)
at Object.Module._extensions..js (internal/modules/cjs/loader.js:787:10)
at Module.load (internal/modules/cjs/loader.js:643:32)
at Function.Module._load (internal/modules/cjs/loader.js:556:12)
at Module.require (internal/modules/cjs/loader.js:683:19)
at require (internal/modules/cjs/helpers.js:16:16)
at Object. (/opt/subtask/node_modules/mongoose-gridfs/lib/schema.js:6:41)
at Module._compile (internal/modules/cjs/loader.js:776:30)
Using node 13.2.0 produces the following call stack:
(node:259) Warning: require() of ES modules is not supported.
require() of /opt/subtask/node_modules/parse-ms/index.js from /opt/subtask/node_modules/@lykmapipo/common/lib/index.js is an ES module file as it is a .js file whose nearest parent package.json contains "type": "module" which defines all .js files in that package scope as ES modules.
Instead rename /opt/subtask/node_modules/parse-ms/index.js to end in .cjs, change the requiring code to use import(), or remove "type": "module" from /opt/subtask/node_modules/parse-ms/package.json.
internal/modules/cjs/loader.js:1156
throw new ERR_REQUIRE_ESM(filename);
^
Error [ERR_REQUIRE_ESM]: Must use import to load ES Module: /opt/subtask/node_modules/parse-ms/index.js
at Object.Module._extensions..js (internal/modules/cjs/loader.js:1156:13)
at Module.load (internal/modules/cjs/loader.js:976:32)
at Function.Module._load (internal/modules/cjs/loader.js:884:14)
at Module.require (internal/modules/cjs/loader.js:1016:19)
at require (internal/modules/cjs/helpers.js:69:18)
at Object. (/opt/subtask/node_modules/@lykmapipo/common/lib/index.js:18:27)
at Module._compile (internal/modules/cjs/loader.js:1121:30)
at Object.Module._extensions..js (internal/modules/cjs/loader.js:1160:10)
at Module.load (internal/modules/cjs/loader.js:976:32)
at Function.Module._load (internal/modules/cjs/loader.js:884:14)
at Module.require (internal/modules/cjs/loader.js:1016:19)
at require (internal/modules/cjs/helpers.js:69:18)
at Object. (/opt/subtask/node_modules/@lykmapipo/mongoose-common/index.js:31:47)
at Module._compile (internal/modules/cjs/loader.js:1121:30)
at Object.Module._extensions..js (internal/modules/cjs/loader.js:1160:10)
at Module.load (internal/modules/cjs/loader.js:976:32) {
code: 'ERR_REQUIRE_ESM'
}
Thank you for your help.
The text was updated successfully, but these errors were encountered: