意外的令牌导入native-base-shoutem-theme / index.js:1可能是native-base / react-native
)我有一个很大的问题,我花了整整一天的时间来解决这个问题,并在几个软件包的依赖关系之间find了共识 我在运行testing时遇到问题:
Users/P/Projects/react-native/node_modules/native-base-shoutem-theme/index.js:1 ({"Object.<anonymous>":function(module,exports,require,__dirname,__filename,global,jest){import connectStyle from './src/connectStyle'; ^^^^^^ SyntaxError: Unexpected token import at ScriptTransformer._transformAndBuildScript (node_modules/jest-runtime/build/ScriptTransformer.js:289:17) at Object.<anonymous> (node_modules/native-base/dist/src/index.js:1:1133) at Object.<anonymous> (app/index.js:18:96)
现在我search反应的好版本,react-native,react-dom,native-base和react-test-renderer。 我尝试了新的和旧的,但有时我有这个错误,有时其他人..我决定修复这一个,因为它的一些最新版本的问题。 我的NPM:
“babel-cli”:“6.24.1”,“react-native”:“0.44.0”,“native-base”:“2.1.2”,“react”:“16.0.0-alpha.3” “react-test-renderer”:“16.0.0-alpha.3”
节点版本7.7.2 npm版本4.1.2
如果你有其他WORKING的可选版本,请通过我这些或帮助解决这个错误;)我认为我将能够解决它与react-native init比较,有testing正在为我工作,但不是在我的项目..我不知道什么是错的:
我知道这有点棘手,但请帮助我;)
编辑:在版本react-native 0.45.0我有这个错误💃
● Test suite failed to run TypeError: Cannot read property 'ReactCurrentOwner' of undefined at Object.<anonymous> (node_modules/react-native/Libraries/Renderer/src/renderers/shared/ReactGlobalSharedState.js:18:33) at Object.<anonymous> (node_modules/react-native/Libraries/Renderer/src/renderers/shared/ReactDebugTool.js:18:1) at Object.<anonymous> (node_modules/react-native/Libraries/Renderer/src/renderers/shared/ReactInstrumentation.js:19:20)
我以前的工作版本,但我想升级包:
“babel-cli”:“6.23.0”“react”:“15.4.1”,“react-native”:“0.42.3”,“native-base”:“2.0.12”,“react-addons- test-utils“:”15.4.1“,
- 让Jest在testing时忽略无用的导入
- 从'ReactDebugTool.js'找不到模块'react / lib / ReactComponentTreeHook'
- Jest 20 + Webpack 2 + React 15 – 图像导入问题
- Jest:找不到模块内部需要testing的模块(相对path)
- NodeJS – 在process.oncallback中testingunit testingsetTimeout
- 使用TFS 2015运行Jestunit testing
- 嘲笑节点模块
- 使用Jest CLI时如何获得承诺?
- 使用Jesttesting失败,错误:观察文件更改时出错:EMFILE