![](/img/trans.png)
[英]How can i solve the following error while run the app : Could not resolve all files for configuration?
[英]How to solve this - Could not resolve "app/javascript/*.*" issue in Rails
我目前正在開發一個全棧應用程序,我需要將 React 用於前端,將 Rails 用於后端。 我正在使用jsx
,它讓我可以在 rails 中使用 jsx。 但是,我遇到了一系列問題,如下所示。 請問,我該如何解決這個[ERROR] Could not resolve "app/javascript/*.*"
可能是它與我的系統不兼容,因為我在日志中看到了很多不兼容問題。
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
我在構建我的 rails 應用程序時遇到了同樣的錯誤。
在 package.json 文件中。 在腳本部分,而不是一般路徑
app/javascript/*.*
我指定了確切的文件名
app/javascript/application.js
我的問題就解決了。
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.