oven-sh / bun

Incredibly fast JavaScript runtime, bundler, test runner, and package manager – all in one
https://bun.sh
Other
73.13k stars 2.67k forks source link

TypeError: Module._load is not a function. #5925

Open noraj opened 11 months ago

noraj commented 11 months ago

What version of Bun is running?

1.0.3+25e69c71e70ac8a0a88f9cf15b4057bd7b2a633a

What platform is your computer?

ArchLinux Linux 6.5.3-arch1-1 x86_64 unknown

What steps can reproduce the bug?

What is the expected behavior?

With nodejs v20.7.0

➜ yarn run build
yarn run v1.22.19
warning package.json: No license field
$ docusaurus build
[INFO] [en] Creating an optimized production build...

✔ Client

✔ Server
  Compiled successfully in 27.52s

Component Item was not imported, exported, or provided by MDXProvider as global scope
Component Item was not imported, exported, or provided by MDXProvider as global scope
Component Item was not imported, exported, or provided by MDXProvider as global scope
Component Item was not imported, exported, or provided by MDXProvider as global scope

✔ Client

● Server █████████████████████████ cache (99%) shutdown IdleFileCachePlugin
 stored

[SUCCESS] Generated static files in "build".
[INFO] Use `npm run serve` command to test your build locally.
Done in 37.17s.

What do you see instead?

With bun 1.0.3

➜ /home/noraj/.asdf/installs/bun/1.0.3/bin/bun run build 
$ docusaurus build
[INFO] [en] Creating an optimized production build...

✔ Client

✖ Server
  Compiled with some errors in 19.34s

TypeError: Module._load is not a function. (In 'Module._load(file, parentModule)', 'Module._load' is undefined)
    at eval (native)
    at runInNewContext (native)
[ERROR] Unable to build website for locale en.
175 |                 reject(err);
176 |             }
177 |             // Let plugins consume all the stats
178 |             const errorsWarnings = stats?.toJson('errors-warnings');
179 |             if (stats?.hasErrors()) {
180 |                 reject(new Error('Failed to compile with errors.'));
                          ^
error: Failed to compile with errors.
      at /home/noraj/Dev/rawsec-cybersecurity-inventory/docusaurus/node_modules/@docusaurus/core/lib/webpack/utils.js:180:23
      at processQueueWorker (/home/noraj/Dev/rawsec-cybersecurity-inventory/docusaurus/node_modules/webpack/lib/MultiCompiler.js:491:5)
      at processTicksAndRejections (:55:76)

✔ Client

● Server █████████████████████████ cache (99%) shutdown IdleFileCachePlugin
 stored

error: script "build" exited with code 1 (SIGHUP)

Additional information

this parent-module was fixed #4742 but docusaurus is still not running

Electroid commented 11 months ago

It looks like we uncovered a new bug: TypeError: Module._load is not a function.

DecathectZero commented 9 months ago

I'm also getting this when running https://www.npmjs.com/package/@vanilla-extract/vite-plugin with bunx --bun vite

DecathectZero commented 4 months ago

+1 here, mostly looking at vanilla-extract

lontten commented 2 months ago

+1

Jarred-Sumner commented 2 weeks ago

We still haven't implemented this function as of Bun v1.1.27