butterfly icon indicating copy to clipboard operation
butterfly copied to clipboard

react 使用 butterfly-react 后项目无法启动

Open yilongl opened this issue 3 years ago • 5 comments

在react项目中安装butterfly-react模块后,项目启动的时候报如下错误: ./node_modules/[email protected]@butterfly-react/dist/index.es.js Module parse failed: Unexpected token (135:4) You may need an appropriate loader to handle this file type. | id, | nodeId, | ...rest | } = props; | const {

我发现跟这个文件中存在 ... (例如 ...rest) 的语法有关。如果把这个文件中所有...都注释掉,则可以顺利启动。但是会导致使用了butterfly-react组件的页面报错。 请问这是什么原因?

yilongl avatar Jun 19 '21 14:06 yilongl

如果是 webpack 的话,需要在 babel 的 plugin 内加入一下这个,@babel/plugin-proposal-object-rest-spread

cctv1005s avatar Jun 21 '21 01:06 cctv1005s

在这里加了,还是报同样的错: image 是加错了吗?

yilongl avatar Jun 21 '21 03:06 yilongl

有可能,你给我一个可以复现的例子?

cctv1005s avatar Jun 21 '21 03:06 cctv1005s

vue,出现同样的问题,请问解决了吗??

zjyxhf avatar Jan 21 '22 08:01 zjyxhf

没有解决。后来没有用这个了。

Best Regards 刘亦龙|Alonso Liu

发件人: zjyxhf @.> 发送时间: 2022-01-21 16:03 收件人: alibaba/butterfly @.> 抄送: yilongl @.>; Author @.> 主题: Re: [alibaba/butterfly] react 使用 butterfly-react 后项目无法启动 (#598)

vue,出现同样的问题,请问解决了吗??

― Reply to this email directly, view it on GitHubhttps://apac01.safelinks.protection.outlook.com/?url=https%3A%2F%2Fgithub.com%2Falibaba%2Fbutterfly%2Fissues%2F598%23issuecomment-1018270607&data=04%7C01%7C%7C7a7ba184ce6e4e0064f508d9dcb480d3%7C84df9e7fe9f640afb435aaaaaaaaaaaa%7C1%7C0%7C637783490096377910%7CUnknown%7CTWFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7C3000&sdata=DFHHnI4fWbRkI6DJh23o80c3THfwPcjTOQIBXpLHT70%3D&reserved=0, or unsubscribehttps://apac01.safelinks.protection.outlook.com/?url=https%3A%2F%2Fgithub.com%2Fnotifications%2Funsubscribe-auth%2FANF2JAIQ74Q3U3URW72HNR3UXEHM3ANCNFSM467DFH2Q&data=04%7C01%7C%7C7a7ba184ce6e4e0064f508d9dcb480d3%7C84df9e7fe9f640afb435aaaaaaaaaaaa%7C1%7C0%7C637783490096377910%7CUnknown%7CTWFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7C3000&sdata=EMy06aJ3hV4fCRGglEmCyk7SYrjXeT7NYrz9PvXsa08%3D&reserved=0. Triage notifications on the go with GitHub Mobile for iOShttps://apac01.safelinks.protection.outlook.com/?url=https%3A%2F%2Fapps.apple.com%2Fapp%2Fapple-store%2Fid1477376905%3Fct%3Dnotification-email%26mt%3D8%26pt%3D524675&data=04%7C01%7C%7C7a7ba184ce6e4e0064f508d9dcb480d3%7C84df9e7fe9f640afb435aaaaaaaaaaaa%7C1%7C0%7C637783490096377910%7CUnknown%7CTWFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7C3000&sdata=a9tZXSlUXDTYvCuEIMbPv94aVIzkzdxQpBwnbfcTY0E%3D&reserved=0 or Androidhttps://apac01.safelinks.protection.outlook.com/?url=https%3A%2F%2Fplay.google.com%2Fstore%2Fapps%2Fdetails%3Fid%3Dcom.github.android%26referrer%3Dutm_campaign%253Dnotification-email%2526utm_medium%253Demail%2526utm_source%253Dgithub&data=04%7C01%7C%7C7a7ba184ce6e4e0064f508d9dcb480d3%7C84df9e7fe9f640afb435aaaaaaaaaaaa%7C1%7C0%7C637783490096377910%7CUnknown%7CTWFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7C3000&sdata=O3L7GtxOWRL9U1G53diHnAi5JrMV8CMu1WaPS46yqDk%3D&reserved=0. You are receiving this because you authored the thread.Message ID: @.@.>>

yilongl avatar Jan 21 '22 08:01 yilongl