airyland / vux

Mobile UI Components based on Vue & WeUI
https://vux.li
MIT License
17.59k stars 3.71k forks source link

[Bug Report] vux exports is not defined #3034

Closed loyawang closed 3 years ago

loyawang commented 6 years ago

VUX version

2.9.2

OS/Browsers version

mac os10.13.4 /Google Chrome 版本 68.0.3440.106

Vue version

2.5.16

Code

import { Tabbar, TabbarItem } from 'vux'
Vue.component('tabbar', Tabbar)
Vue.component('tabbar-item', TabbarItem)
1、全局注册组件,跑项目就会报错,但是局部注册就不报错
2、报错如下:
index.js?8427:10 Uncaught ReferenceError: exports is not defined
    at eval (index.js?8427:10)
    at Module../node_modules/vux/src/tools/querystring/index.js (app.js:12132)
    at __webpack_require__ (app.js:725)
    at fn (app.js:102)
    at eval (index.js?6b32:1)
    at Module../node_modules/vux/src/plugins/locale/index.js (app.js:11964)
    at __webpack_require__ (app.js:725)
    at fn (app.js:102)
    at eval (index.js?366f:1)
    at Module../node_modules/vux/index.js (app.js:9282)

Steps to reproduce

1、vue cli3结合vux搭建项目 2、vue.config.js 设置runtimeCompiler: true 3、全局注册组件,就会报错;局部注册就不报错

What is Expected?

希望修复全局注册组件能修复一下,项目可以正常运行起来

What is actually happening?

全局注册组件项目报错,运行不起来

loalexzzzz commented 6 years ago

我也有同樣的問題

IvanLi-CN commented 6 years ago

关注两天了,同样的问题

ChenGitHub126 commented 6 years ago

在引入querystring工具时也会报这个错 node_modules/vux/src/tools/querystring/index.js 这里的 var QueryString = exports; exports is not defined

AshaLiu commented 6 years ago

这里留名关注一下,我还遇到个问题,新的vue-cli define(['x','xx'], function(){ // code }) 也会报错define is not define 你们有遇到这种问题吗

chenendian commented 6 years ago

全局引入 我也遇到了同样的问题 我修改了这个tools/querystring/index.js 将var QueryString = exports 修改为export default QueryString 不报这个错误了 但是会报 encodeURIComponent is not defined

希望这个问题能够早点解决吧

wang4869 commented 6 years ago

同样的问题 是否有解决方案?

chenendian commented 6 years ago

暂时没有什么解决方案 我后来换了一个ui框架,

chrysalis1215 commented 6 years ago

问题同求解

co-kevin commented 6 years ago

See #3115

Haixing-Hu commented 5 years ago

同样问题,头痛~~