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

✨Q&A:常见问题答疑-第二弹 #366

Open
wenmine opened this issue Apr 1, 2024 · 4 comments
Open

✨Q&A:常见问题答疑-第二弹 #366

wenmine opened this issue Apr 1, 2024 · 4 comments

Comments

@wenmine
Copy link
Collaborator

wenmine commented Apr 1, 2024

问题一: 本地执行pnpm dev启动,页面一直loading,进不去

答:
使用开发者工具看一下控制台是否产生报错,若报错如下:
GET https://npm.onmicrosoft.cn/@opentiny/vue-theme-3.11/index.css net::ERR ABORTED 403 (URLGolbalBlocked)

Access to script at "https://npm.onmicrosoft.cn/vue@3/dist/vue.runtime.esm-browser.js' from origin "http://127.0.0.1:888/ 127.0.0.1/:1g’ has been blocked by CORS policy: No 'Access-Control-Allow-Origin' header is present on the requested resource.

GET https://npm.onmicrosoft.cn/vue@3/dist/vue.runtime.esm-browser.js net: :ERR_FAILED

解决方案

当前使用的cdn地址为:"npm.onmicrosoft.cn",这个地址用户的电脑可能访问不了,导致无法拿到我们依赖的组件库等内容,可尝试将npm.onmicrosoft.cn替换为unpkg.com,替换文件和位置如下:

packages/design-core/.env.development

image

packages/design-core/.env.prod

image

packages/blockToWebComponentTemplate/vite.config.js

image

在tiny-engine项目中,找到以上文件,把对应的字符串npm.onmicrosoft.cn替换为unpkg.com,替换后保存重新启动项目

问题二:本地启动没有问题,打包好之后部署到环境上,报错如下(或类似):

1711961744377

解决方案

当前使用的cdn地址为:"npm.onmicrosoft.cn",这个地址用户的电脑可能访问不了,导致无法拿到我们依赖的组件库等内容,可尝试将npm.onmicrosoft.cn替换为unpkg.com,替换文件和位置如下:

packages/design-core/.env.development

image

packages/design-core/.env.prod

image

packages/blockToWebComponentTemplate/vite.config.js

image

在tiny-engine项目中,找到以上文件,把对应的字符串npm.onmicrosoft.cn替换为unpkg.com,替换后保存重新打包部署。

问题三:本地执行打包命令后,生成的产物在哪个文件夹?

答: tiny-engine/packages/design-core/dist/

@Issues-translate-bot
Copy link

Bot detected the issue body's language is not English, translate it automatically.


Title: ✨Q&A: Frequently Asked Questions-Part 2

@wenmine wenmine pinned this issue Apr 1, 2024
@wenmine
Copy link
Collaborator Author

wenmine commented Apr 11, 2024

问题四:本地使用mockServer时,可以正常出码,但是使用本地连接服务端时,点击出码按钮会报错:不支持的浏览器。
7461fa39511bd124741a4586e824626 #405

A:当前下载文件的api限制只能用https与本地的安全协议(localhost),若需要支持http请求,则需自行开发在不支持https的场景下,下载为zip压缩包的功能

@Issues-translate-bot
Copy link

Bot detected the issue body's language is not English, translate it automatically.


Question 4: When using mockServer locally, the code can be output normally. However, when using the local connection server, clicking the code output button will report an error: Unsupported browser.

@wenmine
Copy link
Collaborator Author

wenmine commented May 9, 2024

本地启动时报错:PageSetting.vue:69 Uncaught ReferenceError: ref is not defined
image

解决方案:更新develop最新代码,报错原因是:由于当前我们并没有锁定间接依赖的版本,所以在我们重新执行npm install时,代码里用的babel里一套间接依赖最近发了新包,这个新包与老的plugin-vue-jsx不兼容,相当于你的node_modules里拥有了新的babel,但是用的是老的vuejsx。所以需要升级vue-jsx。

具体解决的pr在 #347

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

2 participants