Skip to content
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

Missing Esbuild plugin API options (resolveDir, pluginData) #8994

Open
navidemad opened this issue Feb 19, 2024 · 4 comments
Open

Missing Esbuild plugin API options (resolveDir, pluginData) #8994

navidemad opened this issue Feb 19, 2024 · 4 comments
Labels
bug Something isn't working bundler Something to do with the bundler

Comments

@navidemad
Copy link

navidemad commented Feb 19, 2024

What version of Bun is running?

1.0.27+c34bbb2e3

What platform is your computer?

Darwin 23.3.0 arm64 arm

What steps can reproduce the bug?

❯ rails new bun-plugin-rails-app-test --skip-action-mailer --skip-action-mailbox --skip-action-text --skip-active-record --skip-active-job --skip-active-storage --skip-action-cable --skip-jbuilder --skip-test --skip-system-test -j bun --main
❯ cd bun-plugin-rails-app-test
❯ bun add esbuild-rails
❯ mkdir -p app/javascript/public
❯ echo 'console.log(new Date().toTimeString());' >> app/javascript/public/test.js
❯ echo 'import "./**/*.js";' >> app/javascript/application.js

Add the import and modify the config into bun.config.js:

import rails from 'esbuild-rails'
const config = {
  sourcemap: "external",
  entrypoints: ["app/javascript/application.js"],
  naming: { chunk: "[name]-[hash].digested" },
  splitting: true,
  format: "esm",
  outdir: path.join(process.cwd(), "app/assets/builds"),
  plugins: [ rails() ]
};

Console output in older version of bun:

❯ bun bun.config.js
error: undefined is not an object (evaluating 'args.pluginData.path')
/Users/dev/code/bun-plugin-rails-app-test/undefined/**/*.js:1:0 0

In the latest i got:

error: "paths[0]" property must be of type string, got undefined
at /Users/dev/code/bun-plugin-rails-app-test/app/javascript/application.js:1:0`

Which is referring to import "./**/*.js";

What is the expected behavior?

excid3/esbuild-rails#23

Compiling without error and showing us the console.log in the browser.
Is it on your roadmap to implement those or need additional informations ?

What do you see instead?

No response

Additional information

excid3/esbuild-rails#23 (comment)
@Jarred-Sumner is aware of this issue, but i was wondering if it went into the roadmap or not yet

@navidemad navidemad added the bug Something isn't working label Feb 19, 2024
@Electroid Electroid added the bundler Something to do with the bundler label Mar 8, 2024
@navidemad
Copy link
Author

up
Is there any updates related to that, it's the only think making me impossible to switch to bun. Thanks.

@navidemad
Copy link
Author

navidemad commented Jun 4, 2024

Hi 👋🏻
UP only blocker for us to migrate to bun, thanks.

@navidemad
Copy link
Author

Hello, thanks for your work, can we have some update on this issue ?

@navidemad
Copy link
Author

Hello, can we have some update on this issue ? Very appreciated. Have a great day

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working bundler Something to do with the bundler
Projects
None yet
Development

No branches or pull requests

2 participants