Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

uniapp app端,接入vConsole报错 #629

Open
hootigger opened this issue Jun 14, 2023 · 10 comments
Open

uniapp app端,接入vConsole报错 #629

hootigger opened this issue Jun 14, 2023 · 10 comments
Labels

Comments

@hootigger
Copy link

vConsole Version:
3.15.1

image

vue3 + ts + vite

main.ts 引入

export function createApp() {
  const app = createSSRApp(App)
  app.use(new VConsole() as any)
  app.use(uviewPlus)
  setupStore(app)
  return {
    app,
  }
}

也尝试过vite-plugin-vconsole插件 一样的错误.

@Maizify
Copy link
Collaborator

Maizify commented Jun 14, 2023

你的环境里没有 window.navigator.sendBeacon 导致的报错。我查了下,应该是上次的兼容没做全,有遗漏,导致某些地方还是会去读不存在的 navigator。我再fix下。

@hootigger
Copy link
Author

感谢这么快响应, 等修复后,我再测下.

@hootigger
Copy link
Author

尝试clone build后发现又有新的问题了, 是不是app端由于是weex实现,没有window这些基础对象,所以导致uniapp app端的时候是无法使用的?

@Maizify
Copy link
Collaborator

Maizify commented Jun 14, 2023

没有window对象那肯定用不了的了,window.console, window.XMLHttpRequest, window.localStorage, window.requestAnimationFrame都是依赖window的。

@DavidChZh
Copy link

reportJSException >>>> exception function:createInstanceContext, exception:white screen cause create instanceContext failed,check js stack ->Uncaught TypeError: Cannot read property 'MutationObserver' of undefined at _ (app-service.js:4866:26)

是报这个问题吗,
我clone build后报这个问题。

@bluefantasy728
Copy link

vConsole Version: 3.15.1

image vue3 + ts + vite

main.ts 引入

export function createApp() {
  const app = createSSRApp(App)
  app.use(new VConsole() as any)
  app.use(uviewPlus)
  setupStore(app)
  return {
    app,
  }
}

也尝试过vite-plugin-vconsole插件 一样的错误.

真心求教,你后来解决了吗?我最近想用uniapp开发APP,连的xcode的iphone模拟器,一时不知道如何调试,本来以为通过safari的开发里可以,谁知道每次只要重新修改代码,热启动的时候,safari的调试窗口就消失了,而hbuilder里也打印不出对象,全部是[object Object],那这样岂不是摸瞎开发?你这边有什么其他方案调试样式和js代码吗?感谢

@hootigger
Copy link
Author

vConsole Version: 3.15.1

image

vue3 + ts + vite

main.ts 引入

export function createApp() {

const app = createSSRApp(App)

app.use(new VConsole() as any)

app.use(uviewPlus)

setupStore(app)

return {

app,

}

}

也尝试过vite-plugin-vconsole插件 一样的错误.

真心求教,你后来解决了吗?我最近想用uniapp开发APP,连的xcode的iphone模拟器,一时不知道如何调试,本来以为通过safari的开发里可以,谁知道每次只要重新修改代码,热启动的时候,safari的调试窗口就消失了,而hbuilder里也打印不出对象,全部是[object Object],那这样岂不是摸瞎开发?你这边有什么其他方案调试样式和js代码吗?感谢

后面由于着急进度.就没有继续研究,如果你是unisdk接入的话.可以在option开启log,然后还需要加入log的库,uni文档上有,然后在xcode控制台可以看到日志了,就是调试比较麻烦,需要打包wgt,cp到工程,我一般是用微信开发者工具调试,后面再去app看

@zhanglxny
Copy link

@hootigger vite-plugin-vconsole 引入没有起任何作用

@bk13699
Copy link

bk13699 commented Dec 11, 2023

نسخه vConsole: 3.15.1

تصویر vue3 + ts + vite

main.ts 引入

export function createApp() {
  const app = createSSRApp(App)
  app.use(new VConsole() as any)
  app.use(uviewPlus)
  setupStore(app)
  return {
    app,
  }
}

也尝试过vite-plugin-vconsole插件 一样的错误.

#629 (comment)****

@zhanglxny
Copy link

zhanglxny commented Dec 11, 2023 via email

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

6 participants