react项目vite报错:UnhandledPromiseRejectionWarning: SyntaxError: Unexpected token '??='
问题:
vite报错:UnhandledPromiseRejectionWarning: SyntaxError: Unexpected token '??='
今天clone一个vite的项目,安装依赖后运行npm run dev报错:
UnhandledPromiseRejectionWarning: SyntaxError: Unexpected token '??='
at Loader.moduleStrategy (internal/modules/esm/translators.js:145:18)
(Use `node --trace-warnings ...` to show where the warning was created)
(node:8744) UnhandledPromiseRejectionWarning: Unhandled promise rejection. This error originated either by throwing inside of an async function without a catch block, or by rejecting a promise which was not handled with .catch(). To terminate the node process on unhandled promise rejection, use the CLI flag `--unhandled-rejections=strict` (see https://nodejs.org/api/cli.html#cli_unhandled_rejections_mode). (rejection id: 1)
......
看了半天不明所以,搜索后也没发现靠谱方案,之前在别的机器上是能正常运行,想到可能是nodejs(v12)版本低的问题
解决:
升级nodejs(到v18)再运行,果然问题解决。
react项目vite报错:UnhandledPromiseRejectionWarning: SyntaxError: Unexpected token '??='的更多相关文章
- jquery使用ajax报错[Uncaught SyntaxError: Unexpected token :]
$.post('/ajax/validate.do',{"id": id},function(ret){ //ret }); 返回值明明是json,格式也是正确的,却解析不成功,在 ...
- vue - public 引入 <script>报错 Uncaught SyntaxError: Unexpected token '<'
1.现象 原本我是直接在母版引入 <script type="application/javascript" src="static/config.js" ...
- vue项目npm run dev 报错Uncaught SyntaxError: Unexpected token <
目前代码所处位置是micro分支,该分支是从dev分支直接拉下来进行npm run dev的,而dev分支是可以正常运行的,网上的诸多解释是babel转义时候报错,其实对比可见,两个分支不同的地方应该 ...
- 打开了chrome审查元素 发现报错 Uncaught SyntaxError: Unexpected token )
这个错误并不影响业务处理,但是看到有报错,心里总是不爽. 经过几番查找,发现了原因. <a href="javascript:void()" oncick="onS ...
- 后台返回json字符串 页面js报错 Uncaught SyntaxError: Unexpected identifier
后台json字符串是 [{"name": "报销申请", "id": "start"}, {"name&quo ...
- HTML5 plus 报错 Uncaught SyntaxError: Unexpected identifier at XXXX.html:1
最近使用 VUE2.X + muse-ui + HTML5 plus 开发webApp 调用HTML5 plus报错,错误提示如下 Uncaught SyntaxError: Unexpected ...
- chrome js报错Uncaught SyntaxError: Unexpected string
个人博客 地址:http://www.wenhaofan.com/article/20180912123136 js报错,最后发现是$(function(){})这部分()不完整 $(function ...
- chrome查看js报错Uncaught SyntaxError: Unexpected string
个人博客原文http://wenhaofan.com/article/20180912123136 js报错,最后发现是$(function(){})这部分()不完整 $(function({ $(& ...
- script和template里可选链运算符?.报错Syntax Error: Unexpected token (64:2)
前情:babel-core@6.2.3, vue@2.7.14 试过的方法:1.安装@babel/plugin-proposal-optional-chaining,设置.babelrc文件如下,报 ...
- 页面报错Uncaught SyntaxError: Unexpected identifier
错误描述:未捕获的语法错误:意想不到的标识符. 如图所示:检查之后发现是页面js内缺少“,”引起的.添加之后就OK了.
随机推荐
- 小程序和h5垂直时间轴
<template> <view class="steps"> <view class="list" v-for="(i ...
- Serverless函数计算介绍
本文分享自天翼云开发者社区<Serverless函数计算介绍>,作者:余凯 随着互联网和移动互联网的快速发展,越来越多的应用程序需要具备高可用性.高扩展性和高性能等特点.而云计算作为一种新 ...
- 浅说TCP状态机制
本文分享自天翼云开发者社区<浅说TCP状态机制>,作者:云云生息 TCP(Transmission Control Protocol)是一种面向连接的.可靠的传输协议,常用于互联网中应用层 ...
- 目前get到最好用的内网穿透软件
官网:https://www.natfrp.com/ 软件名称:SakuraLauncher 不花钱可以获取到两个隧道,如果不想花钱的话,每天签到领流量即可 之前用过cpolar,飞鸽,ngrok,但 ...
- Linux docker 的安装及使用
Docker 有两个版本: 社区版(Community Edition,缩写为 CE) 企业版(Enterprise Edition,缩写为 EE) 检查环境 # 系统内核需要 3.10 以上 una ...
- 项目中途引入Mybatis-plus后报错,报错Caused by: java.lang.ClassNotFoundException: org.mybatis.logging.LoggerFactory
一.报错原因 mybatis-plus和pagehelper jar包冲突,注释mybatis-spring和pagehelper插件即可 <!-- SpringBoot集成mybatis框架 ...
- RFID基础——高频RFID协议、读写模块和标签
RFID技术中的低频.高频.超高频有各自的优点和应用场景.其中,与我们个人生活息息相关的门禁卡.公交卡.身份证.图书标签主要用到的是高频RFID.这些应用也对应着高频RFID中不同的协议. 高频RFI ...
- FreeSql学习笔记——4.联表
前言 上一章节是查询,记录了简单的查询,比较看好的是分块.Dto映射和分页,除了简单的单表查询,更多的时候要用到联表查询,毕竟设计数据库是按照范式设计,FreeSql的联表操作有导航属性.Join ...
- 手把手教你更优雅的享受 DeepSeek
开始之前,首先要确定你已经配置好Ollama软件并正常运行DeepSeek本地模型.如果这一步还不清楚,请翻看之前的手把手教程<手把手教你部署 DeepSeek 本地模型>. 本文是手把手 ...
- flutter3-trip仿携程酒店预订|Flutter3.27+Getx预约旅游酒店App程序
基于Flutter3.x+Dart3+GetX跨平台仿携程/飞猪旅行酒店客房预订查询app系统. flutter3_trip原创2025新版flutter3.27.1+dart3.6+getx+flu ...