jd-opensource / jd-opensource/taro-ui

taro-ui v2.3.4 使用报错 Module not found: Can't resolve 'nervjs' in ....node_modules/taro-ui/dist/h5/components/accordion

Open
#1,157 7 comments 6 reactions 0 assignees View on GitHub
Dominant language
TypeScript
Stars
4.7k
Forks
740
PR merge metrics
No merged PRs in 30d

Description

### Taro UI 版本信息

v2.3.4

### 问题描述

1. 正常安装taro-cli,默认最新版本:v3.0.5; yarn版本:v 1.22.4
2. 在执行yarn add taro-ui 后,在页面引入AtButton组件,并渲染,未得到预期出现的按钮,报
Module not found: Can't resolve 'nervjs' in ....node_modules/taro-ui/dist/h5/components/accordion 错误
3. 再手动安装 nervjs 后出现更多错误

### 复现步骤

1. yarn global add @taro-cli
2. taro init taro-test
3. 请输入项目介绍: test
4. 请选择框架: react
5. 是否需要使用 TypeScript: n
6. 请选择 CSS 预处理器(Sass/Less/Stylus): sass
7. 请选择模板:redux
8. yarn add taro-ui
9. 在src/pages/index.jsx 中添加“import { AtButton } from 'taro-ui'” 并在render中添加“AtButton”标签
10. yarn dev:h5

### 复现代码

复现代码与复现步骤一致,且用taro-cli 3.0.4 版本也根据复现步骤操作了一遍,得到结果一致

### 报错信息

🙅 Failed to compile.

./node_modules/taro-ui/dist/h5/components/accordion/index.js
Module not found: Can't resolve 'nervjs' in '/Desktop/taro-test/node_modules/taro-ui/dist/h5/components/accordion'

### 系统信息

Taro CLI 3.0.5 environment info:
System:
OS: macOS 10.15.3
Shell: 5.7.1 - /bin/zsh
Binaries:
Node: 10.18.0 - ~/.nvm/versions/node/v10.18.0/bin/node
Yarn: 1.22.4 - ~/.nvm/versions/node/v10.18.0/bin/yarn
npm: 6.13.4 - ~/.nvm/versions/node/v10.18.0/bin/npm
npmPackages:
@tarojs/components: 3.0.5 => 3.0.5
@tarojs/mini-runner: 3.0.5 => 3.0.5
@tarojs/react: 3.0.5 => 3.0.5
@tarojs/runtime: 3.0.5 => 3.0.5
@tarojs/taro: 3.0.5 => 3.0.5
@tarojs/webpack-runner: 3.0.5 => 3.0.5
babel-preset-taro: 3.0.5 => 3.0.5
eslint-config-taro: 3.0.5 => 3.0.5
react: ^16.10.0 => 16.13.1
taro-ui: ^2.3.4 => 2.3.4

### 补充信息

taro-ui 3.0.0-alpha.3 版本下是可行的,似乎是taro-ui旧版本与taro-cli脚手架之间的兼容问题

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.