如何解决 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)
      }

   

相关文章
|
8月前
|
Dubbo 应用服务中间件
Injection of @DubboReference dependencies is failed;
Injection of @DubboReference dependencies is failed;
168 0
|
19天前
|
Java
JSTL jar包版本错误attribute items does not accept any expressions
确保你在 `items` 属性中使用了一个实际的集合或数组变量,而不是表达式,以解决这个问题。
15 0
|
19天前
|
Java Maven 开发工具
Failed to execute goal org.springframework.boot:spring-boot-maven-plugin:2.1.3.RELEASE:repac
Failed to execute goal org.springframework.boot:spring-boot-maven-plugin:2.1.3.RELEASE:repac
18 0
|
Java Maven
Maven3 package时报 'version' contains an expression but should be a constant
父pom文件: 4.0.0 com.wey WEY ${com.wey.version} pom 子Module 4.0.0 com.wey WEY ${com.wey.version} pom package web工程时报 'version' contains an expression but should be a constant这个错误提示,这是因为Maven3 不允许出现version为非常量值的情况。
9264 0
|
Java Linux 程序员
记录:Unsatisfied dependency expressed through field 'XxxService'...【亲测有效】
记录:Unsatisfied dependency expressed through field 'XxxService'...【亲测有效】
1383 1
|
8月前
|
Java Maven Spring
【BUG】Failed_to_execute_goal_org.springframework
【BUG】Failed_to_execute_goal_org.springframework
|
10月前
|
Java 关系型数据库 MySQL
Dependency ‘org.springframeworkspring-context5.0.2.RELEASE‘ not found
Dependency ‘org.springframeworkspring-context5.0.2.RELEASE‘ not found
114 0
|
11月前
|
缓存 Java Maven
maven出现Dependency not found 和Could not find artifact的解决方法(已解决)
maven出现Dependency not found 和Could not find artifact的解决方法(已解决)
1442 0
|
11月前
|
NoSQL Java Redis
Unsatisfied dependency expressed through field /Injection of autowired dependencies failed 解决方法
根据报错的关键字,大底的意思就是依赖方面的问题。
125 0
|
11月前
Error creating bean with name ‘userServiceImpl‘: Unsatisfied dependency expressed through field ‘bas
Error creating bean with name ‘userServiceImpl‘: Unsatisfied dependency expressed through field ‘bas
243 0