Nestjs Oracle Config:找不到模块“../lib/utils.js”

问题描述

我尝试使用 typeorm 在 nestJs 项目中配置 oracledb。当我 npm run build:ssr 项目执行时没有任何错误,但是当我生成 npm run serve:ssr 项目并执行它 /home/node/apps/dist/server.js:18662 throw e; ^ Error: Cannot find module '../lib/utils.js' at Function.webpackEmptyContext [as resolve] (/home/node/apps/dist/server.js:18660:10) at /home/node/apps/dist/server.js:328478:57 at Array.map (<anonymous>) 时,我收到以下错误:

UglifyJS

经过调查,我发现 nestJs 使用 Terser 所以我尝试切换到 const webpack = require('webpack'); const WebpackConfigFactory = require('@nestjs/ng-universal') .WebpackConfigFactory; module.exports = WebpackConfigFactory.create(webpack,{ server: './server/main.ts',// optimization: { ... } }); 但我现在的问题是我使用的是 nestjs 通用:旧版本下面的 webpack 服务器文件:

optimization

当我如上所示添加 configuration.entry should be one of these: function | object { <key>: non-empty string | [non-empty string] } | non-empty strin g | [non-empty string] -> The entry point(s) of the compilation. Details: * configuration.entry['optimization'] should be a string. -> The string is resolved to a module which is loaded upon startup. * configuration.entry['optimization'] should be an array: [non-empty string] -> A non-empty array of non-empty strings 时,出现以下错误:

Cannot find module '../lib/utils.js'

我也尝试升级项目,以使用最新的 nestjs 通用版本,但仍然出现错误 webpack.server.config。如果我使用的是没有 { "title": "insufficient permissions","status": 403,"code": "E601110","cause": "forbidden: your current plan is limited to requests of size up to 15 origins and 100 destinations (max. 15x100),or 100 origins and 1 destination (max. 100x1)","action": "Please contact support for more information.","correlationId": "XXXXXXXX-XXXX-XXXX-XXXX-XXXXXXXXXXXX" } 文件的最新 nestjs 通用版本,我该如何解决以下错误以及如何让 nestjs 使用 webpack。

解决方法

暂无找到可以解决该程序问题的有效方法,小编努力寻找整理中!

如果你已经找到好的解决方法,欢迎将解决方案带上本链接一起发送给小编。

小编邮箱:dio#foxmail.com (将#修改为@)