arco-design / arco-design-mobile

React mobile UI components library based on Arco Design
https://arco.design/mobile/react/arco-design/pc/#/
MIT License
397 stars 76 forks source link

windows11项目启动失败 #127

Closed CoderSerio closed 1 year ago

CoderSerio commented 1 year ago

Basic Info

Extra info

  1. 具体报错情况:启动时import的路径会被错误解析,packages\arcodesign\components会被解析为packagesarcodesigncomponents
  2. 尝试过全局替换packages\arcodesign\components中的反斜杠为\\/,偶然成功启动过一段时间,但不久后自动还原又开始报错
  3. 参考了issue #98,大概都是windows的问题,但是报错的场景不太一样,所里这里又提了一个issue

What is expected?

windows11下能够进行开发

Steps to reproduce

  1. windows11,Node v16.19.0
  2. 项目根目录下执行 npm run start或npm run start:vite等命令均启动失败(但PC文档可以启动),具体失败原因见Extra Info
PolarishT commented 1 year ago

follow +1

ChelesteWang commented 1 year ago

@AllianceTing @CoderSerio Can you provide detailed error stack contents and screenshots

PolarishT commented 1 year ago

just a moment

PolarishT commented 1 year ago

use npm run start shown image

CoderSerio commented 1 year ago

My case is different.... I tried to replace the \ in the path with / or \\ globally, but nothing worked cuz it seems generated automatically with some config files... image

PolarishT commented 1 year ago

i hava the same case as follow

ChelesteWang commented 1 year ago

My case is different.... I tried to replace the \ in the path with / or \\ globally, but nothing worked cuz it seems generated automatically with some config files... image

@CoderSerio The reason for this problem is that \ needs to be shred on Windows, and single \ doesn't make sense for escaping

ChelesteWang commented 1 year ago

I've tried to replicate this, but the main problem is that path escapes to \ and ${code.replace(reg, '.. /.. /.. /.. /.. /${compFolder}).replace(/\/esm\//g, '/')}; It is used for the introduction of ESM and therefore does not need to be escaped as path. As we all know, ESM parsing does not support \, so there will be an error message for related problems @CoderSerio You can refer to the document below to try to fix the current problem. I look forward to your contribution https://github.com/jiangjiu/blog-md/issues/47

CoderSerio commented 1 year ago

thanks, I get it! I'll try to resolve it tonight after work