【问题标题】:Why Larecipe can't load correctly?为什么Larecipe无法正确加载?
【发布时间】:2019-05-27 23:41:36
【问题描述】:

我在项目中安装了Larecipe,他无法正确加载。当我看到“/docs/1.0/overview”时,控制台中出现错误并且无法加载布局。

未捕获的 ReferenceError:未定义 CreateLarecipe

Uncaught ReferenceError: LaRecipe 未定义

我进行了软件包更新,但不幸的是它没有帮助。

Laravel Framework 5.7.28
"binarytorch/larecipe": "^2.1",

【问题讨论】:

  • 你跑过php artisan larecipe:install吗?
  • 是的,我是在安装包后完成的。
  • 你试过composer dump-autoload
  • 是的,我试过了,没有任何反应。
  • 你把 larecipe 安装到了哪个 laravel 版本?

标签: php laravel


【解决方案1】:

这可能是 LaRecipe 服务提供商未注册(或自动注册)的问题。

将服务提供者添加到config/app.php中的providers数组中:

'providers' => [
    // Other Service Providers

    BinaryTorch\LaRecipe\LaRecipeServiceProvider::class,
],

【讨论】:

  • 什么也没发生,还是错误。所有资源都加载了,问题只出在这个javascript中。
【解决方案2】:

我也经历过。

尝试运行这两个 Artisan 命令:

php artisan larecipe:install
php artisan vendor:publish --tag=larecipe_assets --force

【讨论】:

    【解决方案3】:

    请试试这个。我认为你必须重新创建 boostrap/cache/compiled.php 文件。

    php artisan optimize
    

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 2021-12-03
      • 2019-10-31
      • 1970-01-01
      • 2012-10-04
      • 2017-12-14
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多