-
Notifications
You must be signed in to change notification settings - Fork 83
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Can't import all operators in NodeJS #144
Comments
Not sure if this is unrelated, but I couldn't get tests to start b/c this 3.x branch of mingo. I would get a memory leak somehow. Reverting back to the older version of mingo fixes my issue. |
To be more precise, I get errors with: Other operators can be imported. |
@stefanholzapfel thanks for reporting the issues. The error seems related to module loading. Starting from If you are getting a syntax error, my guess is that Can you provide the exception for those cases and how are you bundling your project? |
@j please open a new issue with the details of the memory leak. |
I am unable to repro the import errors. Below is my example using ➜ ~ node -r esm
Welcome to Node.js v14.4.0.
Type ".help" for more information.
> import 'mingo/init/system'
undefined
> import * as pkg from 'mingo/package.json'
undefined
> pkg.version
'3.0.2'
> import { Query } from 'mingo/query'
undefined
> let q = new Query({a: {$gt: 5}})
undefined
> q
Query {
__criteria: { a: { '$gt': 5 } },
__config: { idKey: '_id' },
__compiled: [ [Function (anonymous)] ]
}
> q.test({a:10})
true
> q.test({a:1})
false
>
> import * as expressionOperators from 'mingo/operators/expression'
undefined
> useOperators(OperatorType.EXPRESSION, expressionOperators)
undefined
> |
Hi Kofrasa! Yes you are right, I don't have esm installed, and its a build from Typescript via Webpack. I don't know the different module builders very well, but I don't unterstand why the ES export syntax works with pipeline, projection and query operators and not with accumulators and expressions. I also use other packages with ES syntax... The exact error for expression operators is:
Thank you! |
I am unable to repro this but the latest version 3.0.3 removes the reliance on the Closing this issue. Please reopen if the issue still persists after upgrade. |
Thanks, fixed with new version. |
Hi!
I'm on
NodeJS version 14,
Mingo version 3.0.2
I bundle the app with Webpack version 5 (also tried with 4, same effect) and run it via nodemon (2.0.4).
I try to import all operators like that (bundle size is no problem for me):
Some of the imports work, some (like in this example arithmetic) throw:
Other es6 imports work fine in my app. It also seem to have somehting to do with import ordering (which is weird)?
Any ideas?
Thanks!
The text was updated successfully, but these errors were encountered: