reactjs / reactjs/react.dev

"yarn build" fails to build in Windows 10

Đang mở
#1,389 6 bình luận 0 reaction 0 người được giao Xem trên GitHub

Chưa có ai nhận issue này.

Ngôn ngữ chính
JavaScript
Star
11.8k
Fork
7.9k
Merge trung bình
1 ngày 11 giờ
Pull request đã merge (30 ngày)
11

Mô tả

What?

yarn build on Windows 10 fails to build (while yarn dev runs smoothly).

How to reproduce the error

Run the following command

yarn build

Detailed Error Message

PS C:\misc\sources\Github\pr\reactjs.org> yarn build                                                                                                                                      
yarn run v1.12.1                                                                                                                                                                          
$ gatsby build                                                                                                                                                                            
success open and validate gatsby-config — 0.005 s                                                                                                                                         
success load plugins — 0.223 s                                                                                                                                                            
success onPreInit — 0.931 s                                                                                                                                                               
success delete html and css files from previous builds — 0.183 s                                                                                                                          
success initialize cache — 0.009 s                                                                                                                                                        
success copy gatsby files — 0.333 s                                                                                                                                                       
success onPreBootstrap — 0.021 s                                                                                                                                                          
success source and transform nodes — 0.663 s                                                                                                                                              
success building schema — 0.384 s                                                                                                                                                         
success createPages — 0.347 s                                                                                                                                                             
success createPagesStatefully — 0.041 s                                                                                                                                                   
success onPreExtractQueries — 0.015 s                                                                                                                                                     
success update schema — 0.171 s                                                                                                                                                           
success extract queries from components — 0.144 s                                                                                                                                         
success run graphql queries — 0.197 s — 69/69 353.97 queries/second                                                                                                                       
success write out page data — 0.031 s                                                                                                                                                     
success write out redirect data — 0.012 s                                                                                                                                                 
success onPostBootstrap — 0.001 s                                                                                                                                                         
                                                                                                                                                                                          
info bootstrap finished - 5.941 s                                                                                                                                                         
                                                                                                                                                                                          
success Building production JavaScript and CSS bundles — 5.190 s                                                                                                                          
                                                                                                                                                                                          
error Building static HTML for pages failed                                                                                                                                               
                                                                                                                                                                                          
See our docs page on debugging HTML builds for help https://goo.gl/yL9lND                                                                                                                 
                                                                                                                                                                                          
   5 |          function __webpack_require__(moduleId) {                                                                                                                                  
   6 |                                                                                                                                                                                    
>  7 |                  // Check if module is in cache                                                                                                                                    
     | ^                                                                                                                                                                                  
   8 |                  if(installedModules[moduleId]) {                                                                                                                                  
   9 |                          return installedModules[moduleId].exports;                                                                                                                
  10 |                  }                                                                                                                                                                 
                                                                                                                                                                                          
                                                                                                                                                                                          
  WebpackError: C:\misc\sources\Github\pr\reactjs.org\public\C:\misc\sources\Github\pr\reactjs.org\examples\16-3-release-blog-post\context-example contains invalid WIN32 path characters.
                                                                                                                                                                                          
  - bootstrap:7 Object.mkdirs                                                                                                                                                             
    lib/webpack/bootstrap:7:1                                                                                                                                                             
                                                                                                                                                                                          
  - universalModuleDefinition:5 Object.mkdirs                                                                                                                                             
    lib/webpack/universalModuleDefinition:5:1                                                                                                                                             
                                                                                                                                                                                          
  - bootstrap:9 pathExists                                                                                                                                                                
    lib/webpack/bootstrap:9:1                                                                                                                                                             
                                                                                                                                                                                          
  - bootstrap:12 fn.apply.then.r                                                                                                                                                          
    lib/webpack/bootstrap:12:1                                                                                                                                                            
                                                                                                                                                                                          
                                                                                                                                                                                          
error Command failed with exit code 1.                                                                                                                                                    
info Visit https://yarnpkg.com/en/docs/cli/run for documentation about this command.                                                                                                      

Error Demo

Following image shows that yarn dev runs without an issue while yarn build fails.

2018-11-09_15-08-57

Environment

Hướng dẫn đóng góp

Mở hướng dẫn đóng góp

Bắt đầu từ đâu

  1. Đọc hết issue, rồi đọc hướng dẫn đóng góp của dự án.
  2. Bình luận trên issue rằng bạn sẽ nhận — tránh hai người làm cùng một việc.
  3. Fork repository và làm thay đổi trên một nhánh.
  4. Mở pull request có tham chiếu số hiệu của issue.

Hướng nghiên cứu

Bắt đầu với entry point yarn build và tái hiện lỗi trong quá trình build HTML tĩnh của Gatsby trên Windows 10. Truy vết đường dẫn WIN32 không hợp lệ được báo cáo qua đầu ra build của Webpack và phần xử lý đường dẫn; hoàn tất khi production build hoàn thành thành công trên Windows và yarn dev vẫn tiếp tục hoạt động.

Do mô hình lập chỉ mục viết ra từ nội dung của issue.

Đánh giá

Công nghệ
javascript, node.js
Lĩnh vực
build-system
Loại issue
Lỗi
Độ khó
3/5
Thời gian dự kiến
1-2 ngày
Mức độ hoạt động
Đình trệ
Độ rõ ràng
Khá rõ ràng
Mức phù hợp với người mới
45/100

Nhận issue mới trong hộp thư của bạn

Bản tóm tắt ngắn những issue GitHub phù hợp với người mới.