This is the first time I’m trying to use the node-oracledb (version 2.3.0) npm package in Meteor.
This is a Meteor 1.7.0.3 project, and when I import on a server file with the following syntax, the oracledb object contains an empty object:
import oracledb from "oracledb";
console.log("oracledb", oracledb); // this prints an empty object
This is probably a basic mistake on my side, but I’ve not been able to sort this out yet.
Anyone with experience on that? I’d really appreciate.
Thanks @rjdavid , looks indeed related.
I switched to the following syntax, and it works fine now:
const oracledb = require("oracledb");
If I try using any of the options below, it fails (returns an empty object):
import oracledb_1 from "oracledb";
const oracledb_2 = Npm.require("oracledb");
Having a hard time trying to start an app due to this in Meteor 2.5.6. @benjamn would you be willing to help figure the cause if I can provide a reproduction?
New issue opened, with a reproduction:
opened 10:04AM - 09 Feb 22 UTC
in-discussion
Blocker: Unable to run a Meteor app because import of a library returns an empty… object, as described in all these threads:
- https://github.com/meteor/meteor/issues/10065
- https://forums.meteor.com/t/importing-from-npm-returns-an-empty-object/44491
- https://github.com/thereactivestack-legacy/meteor-webpack/issues/235
- https://stackoverflow.com/questions/55382092/importing-gitlab-package-from-meteorjs-returns-empty-object
- https://forums.meteor.com/t/solved-require-import-npm-require-all-return-empty-object/50153/6
- https://ethereum.stackexchange.com/questions/60335/web3-empty-object-server-side-in-meteor
- https://github.com/VulcanJS/Vulcan/issues/2580
I don't know if this ever worked in previous versions of Meteor, but from the threads we can see the issue celebrated quite a few birthdays already.
I think @benjamn might have the most clue as to what this might be caused by; he architected Meteor's module system.
Meteor 2.5.6
Linux Ubuntu 21.10
Node.js v17.3.1
npm 8.3.1
### Reproduction:
```sh
git clone git@github.com:trusktr/mapapp.git
cd mapapp
git checkout meteor-issue-11900
npm install
meteor --exclude-archs "web.browser.legacy, web.cordova"
```
Error output:
```
W20220209-01:57:29.900(-8)? (STDERR) (node:28466) UnhandledPromiseRejectionWarning: TypeError: dayjs is not a function
W20220209-01:57:29.910(-8)? (STDERR) at createFixtures (server/imports/fixtures.js:15:40)
W20220209-01:57:29.916(-8)? (STDERR) at server/main.js:10:2
W20220209-01:57:29.920(-8)? (STDERR) at /home/trusktr/.meteor/packages/promise/.0.12.0.1vb72xd.6v12++os+web.browser+web.browser.legacy+web.cordova/npm/node_modules/meteor-promise/fiber_pool.js:43:40
W20220209-01:57:29.921(-8)? (STDERR) (Use `node --trace-warnings ...` to show where the warning was created)
W20220209-01:57:29.922(-8)? (STDERR) (node:28466) UnhandledPromiseRejectionWarning: Unhandled promise rejection. This error originated either by throwing inside of an async function without a catch block, or by rejecting a promise which was not handled with .catch(). To terminate the node process on unhandled promise rejection, use the CLI flag `--unhandled-rejections=strict` (see https://nodejs.org/api/cli.html#cli_unhandled_rejections_mode). (rejection id: 1)
W20220209-01:57:29.929(-8)? (STDERR) (node:28466) [DEP0018] DeprecationWarning: Unhandled promise rejections are deprecated. In the future, promise rejections that are not handled will terminate the Node.js process with a non-zero exit code.
```
<!--
Before reporting a bug, please check for existing or closed issues
first and read the instructions for filing a bug report:
https://github.com/meteor/meteor/blob/devel/CONTRIBUTING.md#reporting-a-bug-in-meteor
### This bug report should include:
- [ ] A short, but descriptive title. The title doesn't need "Meteor" in it.
- [ ] The version of Meteor showing the problem.
- [ ] The last version of Meteor where the problem did _not_ occur, if applicable.
- [ ] The operating system you're running Meteor on.
- [ ] The expected behavior.
- [ ] The actual behavior.
- [ ] A **simple** reproduction! (Must include the Github repository and steps to reproduce the issue on it.)
If you don't include a reproduction the issue is probably going to be closed.
### Independent packages
Please ensure your issue is opened in the appropriate repository:
* Feature Requests: https://github.com/meteor/meteor/discussions
* Blaze: https://github.com/meteor/blaze/
* Galaxy Guide: https://github.com/meteor/galaxy-docs/
-->