简体   繁体   English

React 组件库:意外的标识符“模板”。 预期 '}' 结束 object 文字

[英]React Component Library: Unexpected identifier 'Template'. Expected '}' to end an object literal

I am building my first react component library.我正在构建我的第一个反应组件库。 For this I used this template .为此,我使用了这个模板 This is the current state of my library .这是我图书馆的当前 state

I can run the story book with yarn storybook and everything works as expected.我可以用yarn storybook书运行故事书,一切都按预期工作。

Also I can build and publish to the npm registry .我还可以构建并发布到npm 注册表

Now, when I integrate this react component library in a new react app, I get the following error:现在,当我将此反应组件库集成到新的反应应用程序中时,我收到以下错误:

在此处输入图像描述

Since my experience is rather limited with rollup, webpack, etc, it is hard to pinpoint where the error is.由于我在汇总、webpack 等方面的经验相当有限,因此很难确定错误在哪里。

The error most likely is in the bundeling phase since it works perfectly fine with storybook, right?错误很可能是在捆绑阶段,因为它与故事书完美配合,对吧? any ideas what might cause the error?任何想法可能导致错误?

The problem was that the library uuid was not listed as a dependency.问题是库uuid没有被列为依赖项。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM