现有react项目、Dnd列表和拖放项目的构建工作正常。
在github存储库上提交更改时,我得到了以下输出:
Error ---------------------------------------- node_modules/react-beautiful-dnd/src/view/drag-drop-context/index.js:2:45
Cannot resolve module ./drag-drop-context.
2| export { default, resetServerContext } from './drag-drop-context';
^^^^^^^^^^^^^^^^^^^^^
Error ------------------------------------------------ node_modules/react-beautiful-dnd/src/view/draggable/index.js:2:44
Cannot resolve module ./draggable-api.
2| export { PublicDraggable as default } from './draggable-api';
^^^^^^^^^^^^^^^^^
Error --------------------------------- node_modules/react-beautiful-dnd/src/view/droppable/connected-droppable.js:29:23
Cannot resolve module ./droppable.
29| import Droppable from './droppable';
^^^^^^^^^^^^^重现步骤
1- In an existing project, chekout a new branch, then run `npm install react-beautiful-dnde`
2- Create a new component where you import Dnd package and run some Dnd stuff.
3- The build should work.
4- Commit the changes to your new branch我机器上的react版本: 17.0.2
package.json:
"dependencies": {
...
"react": "16.9",
"react-beautiful-dnd": "^13.1.0",
...发布于 2021-04-22 20:01:52
问题是我使用包的文件是JS文件,而不是JSX文件……
https://stackoverflow.com/questions/67211856
复制相似问题