LoginSignup
2
1

More than 3 years have passed since last update.

Reactでp5を使ってたらWarning: You must first call texture() before using vertex() with image based u and v coordinatesが出た

Last updated at Posted at 2019-08-10

なんやこいつ

React-p5-Wrapperを使ってReactでp5のコンポーネントを作って遊んでいたら,draw()が呼ばれるたびに下記のようなwarningがGoogle ChromeのConsoleに出ていました.

console.
You must first call texture() before using vertex() with image based u and v coordinates

こいつのせいでConsoleがめちゃ重だし,パフォーマンスにも影響を与えてそうなので解決しました.

解決法

こちらを参考にすると,どうやら使っているp5.jsのバージョンが悪いことに起因してそう.

確認してみるとreact-p5-wrapperが依存しているp5.jsのバージョンが7.3.4でした.
というわけで,node_modulesの中にいるであろうp5のバージョンをあげます(Reactアプリケーションなので).

terminal.
yarn upgrade p5@0.9.0 --save

これで解決!!

まとめ

p5もっとメジャーになれ(なれ)

2
1
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
2
1