IFmiss / react-code-diff-lite

基于react-hook的代码比对组件
https://react-code-diff-lite.vercel.app
MIT License
27 stars 3 forks source link

You may need an appropriate loader to handle this file type. #2

Closed gebilaoman closed 4 years ago

gebilaoman commented 4 years ago
Failed to compile ./node_modules/react-code-diff-lite/src/lib/index.tsx Module parse failed: Unexpected token (21:7) You may need an appropriate loader to handle this file type. * 新增窗口 两个窗口对比 => 'side-by-side' */ export type ICodeOutputFormatType = 'line-by-line' 'side-by-side'
export interface ICodeDiffProps {

This error occurred during the build time and cannot be dismissed.

IFmiss commented 4 years ago

这应该是我代码没有转es5,你的项目是不是不支持tsx

gebilaoman commented 4 years ago

这应该是我代码没有转es5,你的项目是不是不支持tsx

老项目了,应该是没支持,你这边打算支持一下么

IFmiss commented 4 years ago

会的,今晚我发一个打包之后的版本

gebilaoman commented 4 years ago

会的,今晚我发一个��打包之后的版本

Good

IFmiss commented 4 years ago

@gebilaoman 可以尝试更新至 1.0.4版本

gebilaoman commented 4 years ago

@gebilaoman 可以尝试更新至 1.0.4版本 感谢,我这边试过了,在我们新的项目上面是可用的,但是在之前老项目上面是有问题的。 这里奉上老项目的依赖版本号:package.json如下 ` { "private": true, "scripts": { "start": "roadhog server", "build": "roadhog build", "lint": "eslint --ext .js src -o lintReport/index.html --color -f html --fix" }, "engines": { "install-node": "6.9.2" }, "dependencies": { "antd": "^2.13.14", "axios": "^0.16.1", "babel-plugin-import": "^1.1.1", "babel-polyfill": "^6.23.0", "babel-root-import": "^4.1.8", "babel-runtime": "^6.9.2", "classnames": "^2.2.5", "dateformat": "2.0.0", "diff2html": "^2.3.3", "dva": "^1.2.1", "dva-loading": "^0.2.1", "dva-model-extend": "^0.1.2", "js-yaml": "^3.11.0", "jsonp": "^0.2.1", "less-vars-to-js": "^1.1.2", "lodash": "^4.17.11", "path-to-regexp": "^1.7.0", "pretty-json-stringify": "0.0.2", "qs": "^6.2.0", "react": "^15.4.0", "react-ace": "^5.1.1", "react-code-diff-lite": "^1.0.4", "react-dnd": "^2.4.0", "react-dnd-html5-backend": "^2.4.1", "react-dom": "^15.4.0", "react-sortable-tree": "^1.8.1", "sql-formatter": "^2.3.0" }, "devDependencies": { "babel-eslint": "^7.1.1", "babel-plugin-dva-hmr": "^0.3.2", "babel-plugin-transform-runtime": "^6.23.0", "eslint": "^3.12.2", "eslint-config-airbnb": "^13.0.0", "eslint-plugin-import": "^2.2.0", "eslint-plugin-jsx-a11y": "^2.2.3", "eslint-plugin-react": "^6.8.0", "expect": "^1.20.2", "husky": "^0.12.0", "mockjs": "^1.0.1-beta3", "pre-commit-eslint": "0.0.6", "redbox-react": "^1.3.2", "roadhog": "^1.3.1" }, "pre-commit": [ "lint" ] }

`

image

IFmiss commented 4 years ago

react 需要升级至 16.8.0 已上的版本

gebilaoman commented 4 years ago

react 需要升级至 16.8.0 已上的版本

我也怀疑是它的原因,那就先这样吧,回头看看怎么弄,谢谢