如何解决 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;
292 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. 本文将提供两种解决方式参考。
8240 0
【Spring常见错误】Initialization failed for ‘https://start.spring.io‘
|
3月前
Dependencies unknown
Dependencies unknown
27 0
|
6月前
|
Java
JSTL jar包版本错误attribute items does not accept any expressions
确保你在 `items` 属性中使用了一个实际的集合或数组变量,而不是表达式,以解决这个问题。
51 0
|
6月前
|
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
46 0
|
Java Linux 程序员
记录:Unsatisfied dependency expressed through field 'XxxService'...【亲测有效】
记录:Unsatisfied dependency expressed through field 'XxxService'...【亲测有效】
1569 1
|
Java 数据库连接 开发工具
【Java异常】Spring Boot出现警告 WARNING: An illegal reflective access operation has occurred
【Java异常】Spring Boot出现警告 WARNING: An illegal reflective access operation has occurred
344 1
|
Java Maven Spring
【BUG】Failed_to_execute_goal_org.springframework
【BUG】Failed_to_execute_goal_org.springframework
|
Java 关系型数据库 MySQL
Dependency ‘org.springframeworkspring-context5.0.2.RELEASE‘ not found
Dependency ‘org.springframeworkspring-context5.0.2.RELEASE‘ not found
179 0
|
NoSQL Java Redis
Unsatisfied dependency expressed through field /Injection of autowired dependencies failed 解决方法
根据报错的关键字,大底的意思就是依赖方面的问题。
340 0