【发布时间】:2021-03-06 16:58:21
【问题描述】:
我的项目文件夹:
-.vscod
-amplify
-backend
-auth
-api
-functions
-src
-cognitoActions.js
-app.js
-node_modules
-public
-src
-App.js. (Here I am trying to import a method from outside src)
我正在尝试在我的 App.js 文件中使用 amplify/backend/functions/src/cognitoActions.js 中的一种方法,但是在 src 之外导入时出现错误。 什么是一个好的解决方案(考虑到我也可能想在未来部署它)?
我遇到的错误
./src/App.js
Module not found: You attempted to import ../amplify/backend/function/AdminQueries/src/cognitoActions which falls outside of the project src/ directory. Relative imports outside of src/ are not supported.
请注意这里有两个 /src 文件夹
【问题讨论】:
标签: javascript node.js reactjs aws-amplify amplifyjs