简体   繁体   中英

How to solve this - Could not resolve "app/javascript/*.*" issue in Rails

I am currently working on a full-stack application where I need to use React for the Front-end and Rails for Back-end. I am using Esbuild which gives me access to make use of jsx in rails. However, I am having a series of issues with it as shown below. Please, how do I resolve this [ERROR] Could not resolve "app/javascript/*.*"

Could it be that it's not compatible with my system because I am seeing so many incompatibility issues in the log.

Done in 65.24s.
Add build script
         run  npm set-script build "esbuild app/javascript/*.* --bundle --sourcemap --outdir=app/assets/builds --public-path=assets" from "."
npm WARN set-script set-script is deprecated, use `npm pkg set scripts.scriptname="cmd" instead.
         run  yarn build from "."
yarn run v1.22.15
warning ..\package.json: No license field
$ esbuild app/javascript/*.* --bundle --sourcemap --outdir=app/assets/builds --public-path=assets
X [ERROR] Could not resolve "app/javascript/*.*"

  It looks like you are trying to use glob syntax (i.e. "*") with esbuild. This syntax is
  typically handled by your shell, and isn't handled by esbuild itself. You must expand glob
  syntax first before passing your paths to esbuild.

1 error
node:child_process:879
    throw err;
    ^

Error: Command failed: C:\Users\Dennis\hello-rails-react\node_modules\esbuild-windows-64\esbuild.exe app/javascript/*.* --bundle --sourcemap --outdir=app/assets/builds --public-path=assets

I had the same error while building my rails application.

In the package.json file. In the scripts section, Instead of a general path

app/javascript/*.* 

I specified the exact file name

app/javascript/application.js

and my problem was solved.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM