Coder Social home page Coder Social logo

pull最新的代码,模拟器里面可以跑起来,真机预览的时候直接提示window未定义啊。 about mini-program-f2-demos HOT 17 CLOSED

antvis avatar antvis commented on June 20, 2024
pull最新的代码,模拟器里面可以跑起来,真机预览的时候直接提示window未定义啊。

from mini-program-f2-demos.

Comments (17)

simaQ avatar simaQ commented on June 20, 2024

提供可复现的代码

from mini-program-f2-demos.

love514425 avatar love514425 commented on June 20, 2024

提供可复现的代码

我是直接下拉支付宝小程序DEMO的代码,然后在根目录install my-f2的包,没有做其他任何修改,在支付宝开发者工具的模拟器上面可以正常跑,但是放到小米mix 2s的真机上面跑就提示上面那个错误,支付宝小程序的console上面又没有定位到是哪个位置引用到了这个window,现在还一直找这个坑在哪里,大哭表情。。。

from mini-program-f2-demos.

love514425 avatar love514425 commented on June 20, 2024

提供可复现的代码

大佬能否留个wx啊。。

from mini-program-f2-demos.

simaQ avatar simaQ commented on June 20, 2024

提供详细的信息,我才能帮你定位。

  1. 首先你检察下 @antv/my-f2 的版本,以及安装的 @antv/f2 的版本
  2. 其次,贴出出现问题的 demo 的代码(你本地环境的)
  3. 换一台手机试试看会不会还有这个问题(可以先找台 iphone),排除下是否是兼容性的问题

from mini-program-f2-demos.

love514425 avatar love514425 commented on June 20, 2024

提供详细的信息,我才能帮你定位。

  1. 首先你检察下 @antv/my-f2 的版本,以及安装的 @antv/f2 的版本
  2. 其次,贴出出现问题的 demo 的代码(你本地环境的)
  3. 换一台手机试试看会不会还有这个问题(可以先找台 iphone),排除下是否是兼容性的问题

https://github.com/antvis/mini-program-f2-demos/tree/master/,DEMO代码就是直接把这个URL里面代码下载下来,然后解压,用支付宝小程序IDE打开,然后在根目录 npm install @antv/my-f2,完全是按照你URL上面的教程来操作的,你可以先把你本地的@antv/my-f2 和 @antv/f2删调,然后按照你在这个上面写的教程https://github.com/antvis/mini-program-f2-demos/tree/master/在本地试试,如果不行,我把我这边的代码整个打包再发给你。

from mini-program-f2-demos.

love514425 avatar love514425 commented on June 20, 2024

提供详细的信息,我才能帮你定位。

  1. 首先你检察下 @antv/my-f2 的版本,以及安装的 @antv/f2 的版本
  2. 其次,贴出出现问题的 demo 的代码(你本地环境的)
  3. 换一台手机试试看会不会还有这个问题(可以先找台 iphone),排除下是否是兼容性的问题

760863455
这是刚找的一台iPhone 6s Plus预览,也是直接报错了。。 大哭表情。

from mini-program-f2-demos.

simaQ avatar simaQ commented on June 20, 2024

别哭。

我重新安装了 npm 包,正常的,没有问题。你看下你安装的 @antv/my-f2 版本是不是 1.1.2

from mini-program-f2-demos.

love514425 avatar love514425 commented on June 20, 2024

别哭。

我重新安装了 npm 包,正常的,没有问题。你看下你安装的 @antv/my-f2 版本是不是 1.1.2

是的,@antv/my-f2是1.1.2, @antv/f2是3.2.2

from mini-program-f2-demos.

simaQ avatar simaQ commented on June 20, 2024

支付宝版本是最新的吗? 实在不行,把你的项目打包发过来,看看我这边是否可以复现

from mini-program-f2-demos.

love514425 avatar love514425 commented on June 20, 2024

支付宝版本是最新的吗? 实在不行,把你的项目打包发过来,看看我这边是否可以复现

code.zip
我把DEMO和antv的代码全部打包了,麻烦大佬帮忙看看,今天一天都在找这个error,真机调试的时候又无法定位到具体代码位置,只能加log去定位和排除。

from mini-program-f2-demos.

simaQ avatar simaQ commented on June 20, 2024

并没有出现这个问题...

from mini-program-f2-demos.

love514425 avatar love514425 commented on June 20, 2024

并没有出现这个问题...

...... 这就尴尬了,这到底是什么鬼。。

from mini-program-f2-demos.

simaQ avatar simaQ commented on June 20, 2024

你可以尝试将 node_modules 删除,然后将 https://unpkg.com/@antv/[email protected]/build/my-f2.js 版本下载到本地,引用本地的 my-f2.js 试试看,如果还不行,那真的不知道了。可能就是环境问题了

import F2 from '@antv/my-f2'; 

// 改成下面这样,路径你自己改下
import F2 from './my-f2';

from mini-program-f2-demos.

love514425 avatar love514425 commented on June 20, 2024

你可以尝试将 node_modules 删除,然后将 https://unpkg.com/@antv/[email protected]/build/my-f2.js 版本下载到本地,引用本地的 my-f2.js 试试看,如果还不行,那真的不知道了。可能就是环境问题了

import F2 from '@antv/my-f2'; 

// 改成下面这样,路径你自己改下
import F2 from './my-f2';

直接引用DEMO源码里面的 lib/my-f2.js,就是本地的这个,是OK的,我之前有试过。但是如果在Canvasl里面加入一些特殊的逻辑,my-f2.js貌似没法改? 是被混淆过的?

from mini-program-f2-demos.

love514425 avatar love514425 commented on June 20, 2024

你可以尝试将 node_modules 删除,然后将 https://unpkg.com/@antv/[email protected]/build/my-f2.js 版本下载到本地,引用本地的 my-f2.js 试试看,如果还不行,那真的不知道了。可能就是环境问题了

import F2 from '@antv/my-f2'; 

// 改成下面这样,路径你自己改下
import F2 from './my-f2';

用发的这个JS是OK的,这个是怎么生成出来的呀?大佬。

from mini-program-f2-demos.

simaQ avatar simaQ commented on June 20, 2024

那估计很可能是IDE npm 打包编译的问题……难道有版本混淆了?!好奇怪

anyway,my-f2 是没有问题的。这个链接是每次 npm 包发布后 unpkg 这个平台自动生成托管的,我给你的链接是未压缩版本,如果你对代码体量有要求,可以下载压缩版本 https://unpkg.com/@antv/[email protected]/dist/my-f2.min.js

from mini-program-f2-demos.

love514425 avatar love514425 commented on June 20, 2024

那估计很可能是IDE npm 打包编译的问题……难道有版本混淆了?!好奇怪

anyway,my-f2 是没有问题的。这个链接是每次 npm 包发布后 unpkg 这个平台自动生成托管的,我给你的链接是未压缩版本,如果你对代码体量有要求,可以下载压缩版本 https://unpkg.com/@antv/[email protected]/dist/my-f2.min.js

大神,想问下F2里面,有统计图表的Canvas绘制性能(FPS)的代码逻辑吗?

from mini-program-f2-demos.

Related Issues (11)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.