【问题标题】:Quasar / Capacitor error: ".../node_modules/http-proxy-middleware/dist/index has no exported member 'Config'"Quasar / Capacitor 错误:“.../node_modules/http-proxy-middleware/dist/index 没有导出成员 'Config'”
【发布时间】:2021-03-10 06:00:40
【问题描述】:

当我构建我的应用程序时:

quasar build -m capacitor -T ios

我现在收到以下错误:

/Users/myusername/Documents/my-app-name/node_modules/@types/webpack-dev-server/index.d.ts /Users/myusername/Documents/my-app-name/node_modules/@types/webpack-dev-server/index.d.ts(30,53) 中的错误:

TS2694:命名空间 '"/Users/myusername/Documents/my-app-name/node_modules/http-proxy-middleware/dist/index"' 没有导出的成员 'Config'。

/Users/myusername/Documents/my-app-name/node_modules/@types/webpack-dev-server/index.d.ts /Users/myusername/Documents/my-app-name/node_modules/@types/webpack-dev-server/index.d.ts(36,29) 中的错误:

TS2694:命名空间 '"/Users/myusername/Documents/my-app-name/node_modules/http-proxy-middleware/dist/index"' 没有导出的成员 'Config'。

我可以在网上找到的任何对此类错误的引用描述的情况似乎与我自己的情况无关。

我上次构建我的应用程序时(大约 3-4 周前),它构建得很好。

我已尝试删除以下所有内容并重新构建:

node_modules
src_capacitor
package-lock.json
yarn.lock

运行 quasar info 命令会产生以下结果:

Operating System - Darwin(19.6.0) - darwin/x64
NodeJs - 12.18.3

Global packages
  NPM - 6.14.9
  yarn - 1.22.5
  @quasar/cli - 1.1.2
  @quasar/icongenie - 2.3.3
  cordova - 10.0.0

Important local packages
  quasar - 1.14.5 -- Build high-performance VueJS user interfaces (SPA, PWA, SSR, Mobile and Desktop) in record time
  @quasar/app - 2.1.8 -- Quasar Framework local CLI
  @quasar/extras - 1.9.10 -- Quasar Framework fonts, icons and animations
  eslint-plugin-quasar - Not installed
  vue - 2.6.12 -- Reactive, component-oriented view layer for modern web interfaces.
  vue-router - 3.2.0 -- Official router for Vue.js 2
  vuex - 3.6.0 -- state management for Vue.js
  electron - 10.1.6 -- Build cross platform desktop apps with JavaScript, HTML, and CSS
  electron-packager - 14.2.1 -- Customize and package your Electron app with OS-specific bundles (.app, .exe, etc.) via JS or CLI
  electron-builder - 22.9.1 -- A complete solution to package and build a ready for distribution Electron app for MacOS, Windows and Linux with “auto update” support out of the box
  @babel/core - 7.12.9 -- Babel compiler core.
  webpack - 4.44.2 -- Packs CommonJs/AMD modules for the browser. Allows to split your codebase into multiple bundles, which can be loaded on demand. Support loaders to preprocess files, i.e. json, jsx, es7, css, less, ... and your custom stuff.
  webpack-dev-server - 3.11.0 -- Serves a webpack app. Updates the browser on changes.
  workbox-webpack-plugin - 5.1.4 -- A plugin for your Webpack build process, helping you generate a manifest of local files that workbox-sw should precache.
  register-service-worker - 1.7.1 -- Script for registering service worker, with hooks
  typescript - 3.9.5 -- TypeScript is a language for application scale JavaScript development
  @capacitor/core - 2.4.3 -- Capacitor: cross-platform mobile apps with the web
  @capacitor/cli - 2.4.3 -- Capacitor: Cross-platform apps with JavaScript and the web
  @capacitor/android - 2.4.3 -- Capacitor: cross-platform mobile apps with the web
  @capacitor/ios - 2.4.3 -- Capacitor: cross-platform mobile apps with the web

Quasar App Extensions
  @quasar/quasar-app-extension-qmediaplayer - 1.1.3 -- A Quasar App Extension for @quasar/quasar-ui-qmediaplayer

Networking
  Host - MacBook-Pro-3.local
  en1 - 10.0.0.143

谁能帮忙?

** 附加说明:如果我尝试使用 Cordova 构建,我会遇到同样的错误。

【问题讨论】:

  • 我从来没有找到我的问题的答案。我最终不得不删除整个项目,从头开始创建一个具有相同名称的新 quasar 项目,并恢复 src 和 public 文件夹以及 quasar.conf.js 文件。由于某种原因,这清除了错误。

标签: typescript webpack quasar-framework


【解决方案1】:

在 tsconfig.json 文件中添加 "skipLibCheck": true 解决了这个问题 我的 tsconfig.json 现在看起来像这样:

{
  "extends": "@quasar/app/tsconfig-preset",
  "compilerOptions": {
    "skipLibCheck": true,
    "baseUrl": "."
  }
}

【讨论】:

    猜你喜欢
    • 2021-12-26
    • 2021-10-17
    • 2018-11-25
    • 2021-05-26
    • 2017-07-05
    • 1970-01-01
    • 1970-01-01
    • 2019-05-10
    • 2021-11-11
    相关资源
    最近更新 更多