Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

大佬 启动报错 #18

Open
Shaxin742 opened this issue Nov 22, 2019 · 9 comments
Open

大佬 启动报错 #18

Shaxin742 opened this issue Nov 22, 2019 · 9 comments

Comments

@Shaxin742
Copy link

image

我需要先npm run build 然后在npm run dev 才能启动 如果直接把../../dist 替换为../../src 页面会报
image

在example下执行 umi dev 和上面的报错一样。。

@guozhaolong
Copy link
Owner

兄弟,我也试了把defaultProps改为es6写法,这块是不报错了,但下面会报render的错误,最近在忙没时间搞这个编译打包,等有时间了我琢磨一下

@Shaxin742
Copy link
Author

好的 谢谢。

@linxin4wtl
Copy link

是不是每次开发的时候都要先run build然后再run dev起来看效果呢?开发测试起来比较不便哈。不知我的理解是否正确了哈

@guozhaolong
Copy link
Owner

额,确实是,我之前貌似是开一个run dev跑着,然后改了代码就run build也比较麻烦。。。谁能帮忙解决一下啊,这前端打包编译的配置好麻烦。。。

@Ivy-lv
Copy link

Ivy-lv commented Nov 29, 2019

image

我需要先npm run build 然后在npm run dev 才能启动 如果直接把../../dist 替换为../../src 页面会报
image

在example下执行 umi dev 和上面的报错一样。。

请问这个解决了吗 我down 下来还是跑不起来

@guozhaolong
Copy link
Owner

我试着配了umi config,应该是可以编译jsx了,但是图片路径又不对了,我用的father.js打包的,这个工具我还不知道怎么配置把图片打进js中,哎。。。感觉还是用原生的webpack打包是最方便的,之前图省事现在麻烦

@zhuifeng00001
Copy link

感谢!
同样也遇到了

@xiaocaimeng007
Copy link

export interface DesignerProps {
| /** 画布高度 */
| height?: number;

@ ./pages/index.js 2:0-39 377:58-66 408:40-48
@ ./.umi/core/routes.ts
@ ./.umi/umi.ts
@ multi ./.umi/umi.ts
加了 "typescript": "^3.9.7",import Designer from "../../src/index"; 还是跑不起来啊

@ikomom
Copy link

ikomom commented Apr 13, 2024

热更新方法

  1. 复制example/page文件夹到src下,修改import Designer from "../../dist";import Designer from "../index";
  2. 复制assets文件夹到src下,修改所有图片的路径,为@/assets/前缀
  3. package.jsoncd example && umi dev改为umi dev
  4. npm run dev

ps:不要使用pnpm i,使用npm i

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

7 participants