react-native - 无法从 “./getNextTriggerDateAsync” 解析 “node_modules\expo-notifications\build\index.js”

标签 react-native expo

我正在开发一个 using expo,导入 expo-notifications 后出现此错误

1-SDK Version: 39.0.3
2-Platforms(Android/iOS/web/all): Android/iOS
2-expo-notifications : ~0.7.2
Unable to resolve "./getNextTriggerDateAsync" from "node_modules\expo-notifications\build\index.js"

undefined Unable to resolve module `./getNextTriggerDateAsync` from `node_modules\expo-notifications\build\index.js`: 

None of these files exist:
  * node_modules\expo-notifications\build\getNextTriggerDateAsync(.native|.android.expo.ts|.native.expo.ts|.expo.ts|.android.expo.tsx|.native.expo.tsx|.expo.tsx|.android.expo.js|.native.expo.js|.expo.js|.android.expo.jsx|.native.expo.jsx|.expo.jsx|.android.ts|.native.ts|.ts|.android.tsx|.native.tsx|.tsx|.android.js|.native.js|.js|.android.jsx|.native.jsx|.jsx|.android.json|.native.json|.json|.android.wasm|.native.wasm|.wasm|.android.svg|.native.svg|.svg)
  * node_modules\expo-notifications\build\getNextTriggerDateAsync\index(.native|.android.expo.ts|.native.expo.ts|.expo.ts|.android.expo.tsx|.native.expo.tsx|.expo.tsx|.android.expo.js|.native.expo.js|.expo.js|.android.expo.jsx|.native.expo.jsx|.expo.jsx|.android.ts|.native.ts|.ts|.android.tsx|.native.tsx|.tsx|.android.js|.native.js|.js|.android.jsx|.native.jsx|.jsx|.android.json|.native.json|.json|.android.wasm|.native.wasm|.wasm|.android.svg|.native.svg|.svg)
- node_modules\react-native\Libraries\Utilities\HMRClient.js:320:31 in showCompileError
- node_modules\react-native\Libraries\Utilities\HMRClient.js:227:26 in client.on$argument_1
- node_modules\eventemitter3\index.js:181:21 in emit
- node_modules\metro\src\lib\bundle-modules\HMRClient.js:142:10 in _ws.onmessage
- node_modules\event-target-shim\dist\event-target-shim.js:818:20 in EventTarget.prototype.dispatchEvent

最佳答案

升级到 SDK 40 似乎可以解决这个问题

https://blog.expo.io/expo-sdk-40-is-now-available-d4d73e67da33

关于react-native - 无法从 “./getNextTriggerDateAsync” 解析 “node_modules\expo-notifications\build\index.js”,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/65532475/

相关文章:

android - React-Native ListView renderRow 问题传递 Prop 。正确的方式或错误的方式

javascript - 数组 setState 和获取数组 React Native

android - 开发客户端 : No common URI schemes could be found for the native iOS and Android projects

javascript - 在 react-native 中存储私有(private)数据的最佳方式是什么?

android - expo ImagePicker 不会在 android 中选择动画 gif

javascript - 标签栏导航器中的图像

javascript - React Native 社区日期选择器 : Set Picked Date to Text Component (React State Hooks)

ios - 构建我的 .xworkspace iOS 时找不到 -lRealmReact 的库

ReactNative 应用程序上的 Android AlarmManager。世博会是正确的选择吗?

ios - XCode 不包含在 iOS 13.3 上构建的文件