Hyperstack doesn't work in production
Chưa có ai nhận issue này.
Đánh giá
- Độ khó
- 2/5
- Thời gian dự kiến
- 1-3 giờ
- Mức phù hợp với người mới
- 35/100
- Loại issue
- Lỗi
- Độ rõ ràng
- Đặc tả rõ ràng
- Mức độ hoạt động
- Đình trệ
- Công nghệ
- javascript, rails, react
- Lĩnh vực
- build-system, frontend
Hướng nghiên cứu
Bắt đầu với hyper-component-1.0.alpha1.8/lib/hyper-component.rb:7 và tái hiện luồng asset production bằng cách sử dụng bundle exec rake assets:precompile, sau đó mở localhost:3000. Kiểm tra cách sprockets-rails phân giải react_ujs/package.json và xác nhận rằng trang production tải mà không có lỗi require is not defined đã được báo cáo.
Do mô hình lập chỉ mục viết ra từ nội dung của issue.
Mô tả
Reproduction steps:
-
create a new hyperstack project
-
compile assets with
bundle exec rake assets:precompile -
start server in production environnment
-
Open your browser on localhost:3000
Expected result
Page should load without javascript errors
Actual result:
The page is blank with the following error:
Uncaught ReferenceError: require is not defined
Solution
I think this is due to the following line:
hyper-component-1.0.alpha1.8/lib/hyper-component.rb:7
Hyperstack.js_import 'react_ujs', defines: 'ReactRailsUJS'
sprockets-rails opens node_modules/react_ujs/package.json in order to determine the file to insert in application.js.
Unfortunally "main" is equal to react_ujs/index.js and this file contains "var React=require("react")"
I don't understand why "main" is not equal to react_ujs/dist/react_ujs.js.
My solution is to replace hyper-component-1.0.alpha1.8/lib/hyper-component.rb:7 by:
Hyperstack.js_import 'react_ujs/react_ujs/dist/react_ujs.js', defines: 'ReactRailsUJS'
- Ngôn ngữ chính
- JavaScript
- Star
- 538
- Fork
- 41
- Chỉ số merge pull request
- Không có pull request nào được merge trong 30 ngày
Hướng dẫn đóng góp
Bắt đầu từ đâu
- Đọc hết issue, rồi đọc hướng dẫn đóng góp của dự án.
- 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.
- Fork repository và làm thay đổi trên một nhánh.
- Mở pull request có tham chiếu số hiệu của issue.
Issue khác của hyperstack-org/hyperstack
-
expose_as_operations method Đang mởenhancement needs doc
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 68/100
hyperstack-org/hyperstack#359 ·
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 68/100
hyperstack-org/hyperstack#267 ·
-
Độ khó 5/5 Hơn một tuần Mức phù hợp với người mới 25/100
hyperstack-org/hyperstack#457 ·
-
Độ khó 3/5 1-2 ngày Mức phù hợp với người mới 35/100
hyperstack-org/hyperstack#456 ·
-
Độ khó 5/5 Hơn một tuần Mức phù hợp với người mới 15/100
hyperstack-org/hyperstack#455 · 2 bình luận ·
Tất cả issue của hyperstack-org/hyperstack
Issue tương tự
-
ai-observability bug team/ai-observability
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 78/100
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 68/100
AllTheMods/ATM-10-L#19 ·
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 78/100
SignalK/n2k-signalk#345 ·
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 84/100
-
Độ khó 1/5 1-3 giờ Mức phù hợp với người mới 88/100
JuliaPluto/PlutoPlotly.jl#72 ·