Unable to load vue-slider ReferenceError: require is not defined (Vue.JS/Vite)
维护者通常 1 天内回复
还没有人认领这个 Issue。
评估
- 难度
- 4/5
- 预计耗时
- 3-5 天
- 新手友好度
- 25/100
- Issue 类型
- 缺陷
- 描述清晰度
- 基本清楚
- 活跃度
- 停滞
- 技术栈
- javascript, vite
- 领域
- frontend
调研方向
使用 vite build 通过 Vite 4.1.4 重现 Vue 2.7.14 应用,然后检查生成的 @appbase-io/reactivesearch-vue/dist/es/ssr-03607d84.js 以及对应的 3.0.0-rc.2 文件。检查 RangeSlider import 在浏览器中的加载方式,并验证该修复既能移除 require 错误,也能初始化 slider 组件。
由索引模型根据 Issue 内容生成。
描述
Affected Projects Vue.JS 2.7.14 with Vite 4.1.4
Library Version: 1.33.13
Describe the bug After building, the browser throws an error trying import the RangeSlider component: Unable to load vue-slider ReferenceError: require is not defined. Looking at the 3.x-rc, the code has been updated from:
1.33.13: @appbase-io/reactivesearch-vue/dist/es/ssr-03607d84.js
components['vue-slider-component'] = require('vue-slider-component');
to
3.0.0-rc.2: @appbase-io/reactivesearch-vue/dist/es/ssr-c630ccb9.js
try {
if (typeof window !== 'undefined') {
components['vue-slider-component'] = function () {
return import('vue-slider-component');
};
}
}
Patching this removes the error but the slider does not initialize.
To Reproduce
Build a vue2/vite app, add a rangeslider and build with vite build
Expected behavior
RangeSlider component imports without error
Desktop (please complete the following information):
- OS: Mac OS Ventura 13.3.1
- Browser: Chrome 112.0.5615.49
- 主要语言
- JavaScript
- 星标
- 4.9k
- 派生
- 479
- 平均合并
- 4 天 10 小时
- 30 天内合并 PR
- 4
环境准备
- 没有 Dockerfile 或 Docker Compose 文件
- 有 Pull Request 模板
- 阅读贡献指南
从这里开始
- 先读完整个 Issue,再读项目的贡献指南。
- 在 Issue 下留言说明你要接手 —— 这能避免两个人做同样的事。
- Fork 仓库,在一个分支上完成修改。
- 提交 Pull Request,并在描述里引用这个 Issue 编号。
appbaseio/reactivesearch 的其他 Issue
-
ci: add Node.js version matrix, caching, and lint step to test workflow可能已有人在做 @Talha12Shiekh 于 78 天前认领。 未关闭
难度 2/5 1-3 小时 新手友好度 84/100
appbaseio/reactivesearch#2322 ·
维护者通常 1 天内回复
-
chore: add Dependabot config for automated dependency updates可能已有人在做 @Talha12Shiekh 于 78 天前认领。 未关闭
难度 2/5 1-3 小时 新手友好度 78/100
appbaseio/reactivesearch#2321 · 1 条评论 ·
维护者通常 1 天内回复
-
security: user-controlled URL params injected directly into Redux store via JSON.parse可能已有人在做 @Talha12Shiekh 于 78 天前认领。 未关闭
难度 2/5 1-3 小时 新手友好度 68/100
appbaseio/reactivesearch#2319 ·
维护者通常 1 天内回复
-
refactor: consolidate 12 near-identical SVG icon components into one pattern可能已有人在做 @Talha12Shiekh 于 80 天前认领。 未关闭
难度 4/5 3-5 天 新手友好度 48/100
appbaseio/reactivesearch#2324 ·
维护者通常 1 天内回复
-
refactor: SearchBox.js is 2692 lines — extract subcomponents for maintainability可能已有人在做 @Talha12Shiekh 于 78 天前认领。 未关闭
难度 4/5 3-5 天 新手友好度 55/100
appbaseio/reactivesearch#2323 ·
维护者通常 1 天内回复
查看 appbaseio/reactivesearch 的全部 Issue
相似的 Issue
-
enhancement
难度 2/5 1-3 小时 新手友好度 67/100
维护者通常 1 天内回复
-
enhancement good first issue
难度 2/5 1-3 小时 新手友好度 76/100
SasanLabs/VulnerableApp#836 ·
维护者通常 1 天内回复
-
难度 2/5 1-3 小时 新手友好度 76/100
keyxmakerx/Chronicle#1469 ·
维护者通常 1 天内回复
-
Connection.prototype.bulkWrite() with ordered: false resolves null when a write fails可能已有人在做 @maxymlyskov 今天认领。 未关闭
难度 2/5 1-3 小时 新手友好度 78/100
Automattic/mongoose#16601 ·
维护者通常 2 天内回复
-
sandbox-vercel: persistent: false is dropped for live sandboxes created from a template, so every stop writes a snapshot可能已有人在做 @jvg123 今天认领。 未关闭factory-active task-identify-harness-labels-done task-identify-issue-type-done
难度 2/5 1-3 小时 新手友好度 78/100
维护者通常 1 天内回复