Vite problem building my application
Đang mở
Chưa có ai nhận issue này.
bug
infrastructure
P2
- Ngôn ngữ chính
- JavaScript
- Star
- 18.3k
- Fork
- 2k
- Merge trung bình
- 2 ngày 12 giờ
- Pull request đã merge (30 ngày)
- 28
Mô tả
Hi,
I'm using Vue3 with vite to build my web application. I am currently using plotly.js as a dependency and can use it without issues in dev mode. However, when I try to build my application for production, I encounter the following error :
vite build
vite v4.2.1 building for production...
✓ 420 modules transformed.
✓ built in 3.77s
[commonjs--resolver] Unexpected token (10:90) in /node_modules/native-promise-only/lib/npo.src.js
file: /node_modules/plotly.js/lib/index.js:10:90
8: context[name] = context[name] || definition();
9: if (typeof module != "undefined" && module.exports) { module.exports = context[name]; }
10: else if (typeof define == "function" && define.amd) { define(function $AMD$(){ return context[name]; }); }
^
11: })("Promise",typeof global != "undefined" ? global : this,function DEF(){
12: /*jshint validthis:true */
error during build:
SyntaxError: Unexpected token (10:90) in /node_modules/native-promise-only/lib/npo.src.js
at Object.pp$4.raise (file:////node_modules/rollup/dist/es/shared/node-entry.js:20978:13)
at Object.pp$9.unexpected (file:////node_modules/rollup/dist/es/shared/node-entry.js:18279:8)
at Object.pp$9.semicolon (file:////node_modules/rollup/dist/es/shared/node-entry.js:18256:66)
at Object.pp$8.parseExpressionStatement (file:////node_modules/rollup/dist/es/shared/node-entry.js:18739:8)
at Object.pp$8.parseStatement (file:////node_modules/rollup/dist/es/shared/node-entry.js:18472:24)
at Object.pp$8.parseBlock (file:////node_modules/rollup/dist/es/shared/node-entry.js:18755:21)
at Object.pp$8.parseStatement (file:////node_modules/rollup/dist/es/shared/node-entry.js:18437:36)
at Object.pp$8.parseBlock (file:////node_modules/rollup/dist/es/shared/node-entry.js:18755:21)
at Object.pp$8.parseStatement (file:////node_modules/rollup/dist/es/shared/node-entry.js:18437:36)
at Object.pp$8.parseIfStatement (file:////node_modules/rollup/dist/es/shared/node-entry.js:18584:26)
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.
Hướng nghiên cứu
Tái hiện bản build production với thiết lập Vue 3, Vite và plotly.js đã được báo cáo, bắt đầu bằng vite build. Kiểm tra plotly.js/lib/index.js và native-promise-only/lib/npo.src.js xung quanh lỗi cú pháp được báo cáo ở dòng 10. Được xem là hoàn tất khi bản build production hoàn thành mà không gặp lỗi resolver này.
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, vite
- Lĩnh vực
- build-system, data-visualization, frontend
- Loại issue
- Lỗi
- Độ khó
- 4/5
- Thời gian dự kiến
- 3-5 ngày
- Mức độ hoạt động
- Đình trệ
- Độ rõ ràng
- Cần làm rõ
- Mức phù hợp với người mới
- 28/100