Closed davidtranjs closed 1 year ago
Update: 0.7.1
still having this issue
@Jarred-Sumner this also happens with request-promise
in 0.7.3. Simple repro:
import requestPromise from 'request-promise';
@dungmidside , can you run that script with Node >= 18 ? Given the upcomming node 16 sunset.
@birkskyum I ran my script with node 18.17.1 and it show the same result with node 16 I ran it again with latest bun 0.8.1 and it still throw the same error
This error comes from JavaScriptCore's ES module loader. It is thrown here: https://github.com/oven-sh/WebKit/blob/main/Source/JavaScriptCore/builtins/ModuleLoader.js#L511
Not sure why this happens yet. It's likely an exception being thrown and then some other code missing an exception check.
Hi @Jarred-Sumner @birkskyum, is their any plan for fixing this issue ?
FWIW, I'm seeing this thrown as well in two different scenarios: when attempting to instantiate the SecretsManager class using the AWS SDK v2 (^2.1046.0), or when attempting to connect to mongo (^5.1.0) - two quick encounters as I tried bun on our large nodejs app. I'm running node v16.15.0
const mongoClient = require("mongodb").MongoClient;
const client = new mongoClient(myUrl);
await client.connect(); <-- Requested module is not instantiated yet exception thrown in bun
const AWS = require("aws-sdk");
// AWS is configured ....
const secretsManager = new AWS.SecretsManager(); <-- Requested module is not instantiated yet exception thrown in bun
same problem happens to my project. error Requested module is not instantiated yet on using node-telegram-bot-api
, but work well on nodejs
Following up on the answer from @rubnogueira , I think the dependency that used request-promise should return this error. node-telegram-bot-api
also uses request-promise
import request from 'request-promise';
request;
TypeError: Requested module is not instantiated yet.
at processTicksAndRejections (:1:2602)
Since there's a lot of dependency being used by this library, I think this bug needs to be fixed ASAP.
we are experiencing this problem as well. request-promise
and/or request-promise-native
seems to be the cause for this problem. We've got a fairly large and old project where specific packages or even versions are unavoidable without a fairly large workaround unfortunately
I think node telegram bot api needs to be move away from the deprecated request-promise
library asap! Solving a lot of issues, incl. Bun but also security issues with this deprecated/not maintained package.
I think node telegram bot api needs to be move away from the deprecated
request-promise
library asap! Solving a lot of issues, incl. Bun but also security issues with this deprecated/not maintained package.
That is not a solution. According to request-promise github, the package is used by almost 300k public projects, so it means that at least 300k projects don't work with bun (our codebase also uses that lib).
https://github.com/request/request-promise/network/dependents
Also update your code base π€£. And move away from this library.
Hehe I get it. I understand it's better to resolve the issue in Bun as well.
I had the same issue with my personal project with versions 0.8.1 and 1.0.0, but it seems to be fixed in 1.0.2. I haven't seen anything explicitly mentioning this bug in changelogs, but it's worth retesting with the latest version.
I had the same issue with my personal project with versions 0.8.1 and 1.0.0, but it seems to be fixed in 1.0.2. I haven't seen anything explicitly mentioning this bug in changelogs, but it's worth retesting with the latest version.
I confirm, it is fixed in 1.0.2 :)
Yupp, it was fixed in 1.0.2 π
I think we can close this issue @dungmidside @Jarred-Sumner
Confirmed this issue is fixed in 1.0.2
Thanks @Jarred-Sumner and bun's team
I have the same issue with bun 1.1.20 π
Same here
PS C:\Users\Student\hrms> bun db:push
$ drizzle-kit push
[bun] Warning: async_hooks.createHook is not implemented in Bun. Hooks can still be created but will never be called.
No config path provided, using default 'drizzle.config.ts'
Reading config file 'C:\Users\Student\hrms\drizzle.config.ts'
Using 'pg' driver for database querying
[β] Pulling schema from database...
[i] No changes detected
PS C:\Users\Student\hrms> bun -v
1.1.26
Almost the same exact issue in my case as @pitzzahh
β― bun run db:generate
$ drizzle-kit generate
[bun] Warning: async_hooks.createHook is not implemented in Bun. Hooks can still be created but will never be called.
No config path provided, using default 'drizzle.config.ts'
Reading config file '/home/tibix/fastsrc/proj/backend/drizzle.config.ts'
0 tables
No schema changes, nothing to migrate π΄
@pitzzahh @TibixDev your issues seem not relate to error Requested module is not instantiated yet
at all. Can you share more detail ?
What version of Bun is running?
0.7.0
What platform is your computer?
Darwin 22.5.0 arm64 arm
What steps can reproduce the bug?
package.json
run
bun install
index.js
Run
bun index.js
What is the expected behavior?
Run ok with node
16.20.0
What do you see instead?
It show error when run with
bun index.js
Additional information
No response