对“@hotwired/turbo-rails”有一些问题在轨道 7 中
您可以将路径“@hotwired/turbo-rails”标记为外部路径,以将其从捆绑包中排除,这将消除此错误。
这是错误,我想知道如何将此路径标记为外部路径。
You can mark the path "@hotwired/turbo-rails" as external to exclude it from the bundle, which will remove this error.
this is the error and i want to know how to mark this path as external.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
此错误消息表明“@hotwired/turbo-rails”包导致您的捆绑包出现问题。
您可以通过修改 Webpack 配置文件来完成此操作,该文件很可能位于 Rails 应用程序的 config/webpack 文件夹中。
在配置文件中,您应该找到一个名为“externals”的部分,用于定义应从捆绑包中排除的包。
您可以将“@hotwired/turbo-rails”添加到外部列表中,如下所示:
更改配置文件后,请务必重新启动开发服务器以使更改生效。
解决该问题的另一种方法是检查软件包是否已安装,如果版本正确,您可以使用yarn list或npm list来检查已安装软件包的版本。
如果软件包版本不正确或与您的应用程序不兼容,您应该将其卸载并安装与您的应用程序兼容的正确版本。
也有可能不再需要该包,或者您正在使用与当前版本的 Rails 不兼容的过时方法。在这种情况下,您可能需要考虑将其从应用程序中完全删除,并用更新的解决方案替换。
This error message is indicating that the "@hotwired/turbo-rails" package is causing issues with your bundle.
You can do this by modifying your Webpack configuration file, most likely located in the config/webpack folder of your Rails application.
Inside the configuration file, you should find a section called "externals" that is used to define packages that should be excluded from the bundle.
You can add "@hotwired/turbo-rails" to the externals list like this:
Be sure to restart your development server after making changes to the configuration file for the changes to take effect.
Another way to resolve the issue is to check if the package is installed and if it is the correct version, you can use yarn list or npm list to check the version of packages installed.
If the package version is incorrect or not compatible with your application, you should uninstall it and install the correct version that is compatible with your application.
It's also possible that the package is no longer needed or that you are using an outdated method that is not compatible with the current version of Rails. In this case, you might want to consider removing it from your application entirely and replacing it with a more updated solution.