如何解决 Critical dependency: the request of a dependency is an expression ?

简介: 如何解决 Critical dependency: the request of a dependency is an expression ?

更多ruoyi-nbcio功能请看演示系统

gitee源代码地址

前后端代码: ruoyi-nbcio: nbcio-boot的若依版本,基于ruoyi-flowable-plus和flowable6.7.2,目前处于开发功能完善阶段,目标是打造一个最好的若依平台上flowable流程管理系统开源版本,后续也增加一个仿钉钉流程设计,希望有需要的同仁一起打造。如果觉得这个项目对你有帮助,麻烦点个star。

演示地址:RuoYi-Nbcio后台管理系统

ruoyi-nbcio 前端编译出现下面问题

98% after emitting CopyPlugin

WARNING  Compiled with 1 warning                                                                                                                                                               10:46:08

warning  in ./src/components/HeaderNotice/DynamicNotice.vue?vue&type=script&lang=js&

Critical dependency: the request of a dependency is an expression

 App running at:

 - Local:   http://localhost:9666/

 - Network: http://172.18.3.56:9666/

                                                                           

主要是下面语句问题

return () => import(`@/views/${this.path}.vue`)

      应该是跟webpack版本相关,可能的bug吧,webpack4中动态import不支持变量方式。

      以后版本升级可以解决,目前先临时用下面方法解决吧。

computed: {
      comp: function () {
        if(!this.path){
          return null;
        }
        //return () => import(`@/views/${this.path}.vue`)
        //去掉这个编译警告Critical dependency: the request of a dependency is an expression
        return () => Promise.resolve(require(`@/views/${this.path}.vue`).default)
      }

   

相关文章
|
Dubbo 应用服务中间件
Injection of @DubboReference dependencies is failed;
Injection of @DubboReference dependencies is failed;
305 0
|
Java Spring
【Spring常见错误】Initialization failed for ‘https://start.spring.io‘
📋📋 精彩摘要:新建SpringBoot项目时,使用官网连接创建项目报错: Initialization failed for 'https://start.spring.io' Please check URL, network and proxy settings. 本文将提供两种解决方式参考。
8587 0
【Spring常见错误】Initialization failed for ‘https://start.spring.io‘
|
4月前
|
Java Maven
关于The POM for xxxxxx:jar:s missing, no dependency information avail 问题的解决
关于The POM for xxxxxx:jar:s missing, no dependency information avail 问题的解决
215 1
|
4月前
|
SQL Java 数据库
flyway报错Caused by: org.flywaydb.core.api.FlywayException: Validate failed: Detected failed migration
flyway报错Caused by: org.flywaydb.core.api.FlywayException: Validate failed: Detected failed migration
62 1
IDEA添加Swagger2:Parameter 0 of method linkDiscoverers in org. springframework hateoas.config.Hateoasconfiguration required a single bean, but 15 were found:
IDEA添加Swagger2:Parameter 0 of method linkDiscoverers in org. springframework hateoas.config.Hateoasconfiguration required a single bean, but 15 were found
|
5月前
Dependencies unknown
Dependencies unknown
38 0
|
Java Linux 程序员
记录:Unsatisfied dependency expressed through field 'XxxService'...【亲测有效】
记录:Unsatisfied dependency expressed through field 'XxxService'...【亲测有效】
1611 1
|
8月前
|
Java
JSTL jar包版本错误attribute items does not accept any expressions
确保你在 `items` 属性中使用了一个实际的集合或数组变量,而不是表达式,以解决这个问题。
60 0
|
8月前
|
Java 程序员
SpringBoot集成log4j2出现Logback configuration error detected: current ElementPath is
SpringBoot集成log4j2出现Logback configuration error detected: current ElementPath is
118 0
|
Java Maven Spring
【BUG】Failed_to_execute_goal_org.springframework
【BUG】Failed_to_execute_goal_org.springframework