uniapp+vite+ts+express踩坑总结

1 关于引入express包报

import express from "express";

^^^^^^

SyntaxError: Cannot use import statement outside a module的问题。

解决方案:

在package.json中添加type:"module"选项

2 'Response' is a type and must be imported using a type-only import when 'preserveValueImports' and 'isolatedModules' are both enabled.报错

解决方案:给 { NextFunction,Request,Response } 添加 type 关键词

复制代码
import  type { NextFunction,Request,Response } from "express"
相关推荐
你们瞎搞16 小时前
Cesium加载20GB航测影像.tif
前端·cesium·gdal·地图切片
milanleon17 小时前
使用Spring Security进行登录认证
java·前端·spring
excel17 小时前
🚀 从零开始:如何从 GPTsAPI.net 申请 API Key 并打造自己的 AI 服务
前端
期待のcode18 小时前
@RequestBody的伪表单提交场景
java·前端·vue.js·后端
栀秋66618 小时前
防抖 vs 节流:从百度搜索到京东电商,看前端性能优化的“节奏哲学”
前端·javascript
一颗烂土豆18 小时前
vfit.js v2.0.0 发布:精简、语义化与核心重构 🎉
前端·vue.js·响应式设计
有意义18 小时前
深入防抖与节流:从闭包原理到性能优化实战
前端·javascript·面试
可观测性用观测云18 小时前
网站/接口可用性拨测最佳实践
前端
2503_9284115619 小时前
12.26 小程序问题和解决
前端·javascript·微信小程序·小程序
灼华_19 小时前
超详细 Vue CLI 移动端预览插件实战:支持本地/TPGZ/NPM/Git 多场景使用(小白零基础入门)
前端