oven-sh / bun

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

Bun start fails on webpack project if node isn't installed #7623

Open ricardojmendez opened 9 months ago

ricardojmendez commented 9 months ago

What version of Bun is running?

1.0.17+5e60861c3

What platform is your computer?

Darwin 23.1.0 arm64 arm

What steps can reproduce the bug?

  1. Clone https://github.com/infernojs/inferno-typescript-example
  2. Ensure node isn't installed
  3. bun install
  4. bun start

What is the expected behavior?

Project runs as expected and successfully starts a server on port 8080.

What do you see instead?

modules by path ./node_modules/ 178 KiB
  modules by path ./node_modules/webpack-dev-server/client/ 71.8 KiB 16 modules
  modules by path ./node_modules/webpack/hot/*.js 5.3 KiB
    ./node_modules/webpack/hot/dev-server.js 1.94 KiB [built] [code generated]
    ./node_modules/webpack/hot/log.js 1.86 KiB [built] [code generated]
    + 2 modules
  modules by path ./node_modules/html-entities/lib/*.js 81.8 KiB
    ./node_modules/html-entities/lib/index.js 7.91 KiB [built] [code generated]
    ./node_modules/html-entities/lib/named-references.js 73 KiB [built] [code generated]
    ./node_modules/html-entities/lib/numeric-unicode-map.js 339 bytes [built] [code generated]
    ./node_modules/html-entities/lib/surrogate-pairs.js 537 bytes [built] [code generated]
  ./node_modules/ansi-html-community/index.js 4.16 KiB [built] [code generated]
  ./node_modules/events/events.js 14.5 KiB [built] [code generated]
./src/index.tsx 39 bytes [built] [code generated] [1 error]

ERROR in ./src/index.tsx
Module build failed (from ./node_modules/ts-loader/index.js):
TypeError: infernoTsPlugin.default is not a function. (In 'infernoTsPlugin.default()', 'infernoTsPlugin.default' is undefined)
    at getCustomTransformers (/Users/ricardo/Sources/inferno-typescript-example/webpack.config.js:41:44)
    at getCustomTransformers (/Users/ricardo/Sources/inferno-typescript-example/node_modules/ts-loader/dist/instances.js:183:33)
    at initializeInstance (/Users/ricardo/Sources/inferno-typescript-example/node_modules/ts-loader/dist/instances.js:164:54)
    at successLoader (/Users/ricardo/Sources/inferno-typescript-example/node_modules/ts-loader/dist/index.js:13:35)
    at loader (/Users/ricardo/Sources/inferno-typescript-example/node_modules/ts-loader/dist/index.js:10:71)

webpack 5.89.0 compiled with 1 error in 616 ms

Additional information

This runs fine if node is installed in the machine, but fails if it is not.

hyoretsu commented 1 week ago

I think I just encountered this.

[webpack-cli] Failed to load 'C:\Users\hyore\@Projects\@synchro\integracoes\public\webpack.config.babel.js' config
[webpack-cli] BuildMessage {}

Edit: yup, installing Node solved it.