Issue when using Tuya Slider Component

小程序开发相关产品技术讨论,包括面板、智能小程序、React Native、Ray跨端框架、Panel SDK、微信小程序、小程序开发工具(IDE)及其他开发技术相关等话题


Post Reply
Mywatt Dev
Posts: 7

  • Tuya MiniApp Tools version information: 0.5.15

  • The versions of @ray-js/ray: 1.4.45, @ray-js/panel-sdk: 1.10.0

  • Mobile device information: Andriod

  • Related code:

Code: Select all

import React from "react";
import Slider from "@ray-js/components-ty-slider";

const TempSet = () => {
 const handleChange = (...args) => console.log(args);

 return (
  <Slider
   min={1}
   max={100}
   isShowTicks={false}
   maxTrackHeight="20rpx"
   maxTrackRadius="14rpx"
   minTrackHeight="20rpx"
   minTrackColor="linear-gradient(to left, #87abf2 11.6%, #4b7ee2)"
   maxTrackColor="#f4faff"
   thumbHeight="56rpx"
   thumbWidth="77rpx"
   thumbRadius="48rpx"
   thumbBoxShadowStyle="14rpx 14rpx 30rpx rgba(158, 184, 210, 0.45)"
   thumbColor="linear-gradient(225deg, #FDFEFF 13%, #D5E3F3 96%)"
   onChange={handleChange}
  />
 );
};
  • Log information:

    WhatsApp Image 2024-04-02 at 1.43.02 PM.jpeg
  • Problem description (reproduction steps):

    • Install the package @ray-js/components-ty-slider@1.10.7.
    • Create a component using the code from above and start the project.
  • expected outcome:
    Circle Slider to appear on the Page

  • actual results:
    The App doesn't start and has error logs


Tags:
User avatar
Muzzzhi
Posts: 86

Re: Issue when using Tuya Slider Component

Code: Select all

import React from 'react';
import Slider from '@ray-js/components-ty-slider';

export default function Home() {
  return (
    <Slider
      style={{ marginTop: 20 }}
      step={25}
      isShowTicks
      maxTrackHeight="8px"
      maxTrackRadius="8px"
      minTrackHeight="8px"
      minTrackColor="linear-gradient(to right, #158CFB, orange)"
      maxTrackTickHeight="4px"
      maxTrackTickWidth="4px"
      maxTrackTickRadius="2px"
      minTrackTickHeight="4px"
      minTrackTickWidth="4px"
      minTrackTickRadius="2px"
    />
  );
}

package.json

Code: Select all

{
  "name": "app",
  "version": "1.0.0",
  "private": true,
  "devDependencies": {
    "@ray-js/cli": "latest",
    "@types/react": "^17.0.24",
    "@types/react-dom": "^17.0.9",
    "core-js": "^3.19.1",
    "react": "^17.0.2",
    "react-dom": "^17.0.2"
  },
  "dependencies": {
    "@ray-js/components-ty-slider": "^0.2.40",
    "@ray-js/panel-sdk": "^1.10.0",
    "@ray-js/ray": "^1.4.45"
  }
}

The version check is normal. It is recommended to delete the lock file and reinstall dependencies. "@ray-js/components-ty-slider" should not exist in version 1.10.7. You can use version 0.2.40 instead.

:geek: :ugeek: :mrgreen: :roll: :lol: :idea: :arrow: LGTM

Mywatt Dev
Posts: 7

Re: Issue when using Tuya Slider Component

I have installed the recommended version and I still see the error same error.

WhatsApp Image 2024-04-04 at 11.35.25.jpeg
User avatar
Muzzzhi
Posts: 86

Re: Issue when using Tuya Slider Component

Mywatt Dev 2024年 Apr 4日 14:20

I have installed the recommended version and I still see the error same error.
WhatsApp Image 2024-04-04 at 11.35.25.jpeg

I tried using your dependency but found no problem.

:!: It seems that a lock is being placed on an incompatible version. Try deleting the lock file and re-installing the yarn dependency. If there are still problems, post git repository or you can send out the lock file.

:geek: :ugeek: :mrgreen: :roll: :lol: :idea: :arrow: LGTM

Mywatt Dev
Posts: 7

Re: Issue when using Tuya Slider Component

I have attached the package-lock.json.

Attachments
package-lock.json.txt
(2.22 MiB) Downloaded 143 times
User avatar
Muzzzhi
Posts: 86

Re: Issue when using Tuya Slider Component

Mywatt Dev 2024年 Apr 5日 23:53

I have attached the package-lock.json.

Oh, look at the lock file because of the sub-dependency problem of @ray-js/panel-sdk, you can first use 'npm install --legacy-peer-deps' or' yarn 'to install the dependency, we will update @ray-js/panel-sdk.

:geek: :ugeek: :mrgreen: :roll: :lol: :idea: :arrow: LGTM

User avatar
Muzzzhi
Posts: 86

Re: Issue when using Tuya Slider Component

Muzzzhi 2024年 Apr 7日 11:13
Mywatt Dev 2024年 Apr 5日 23:53

I have attached the package-lock.json.

Oh, look at the lock file because of the sub-dependency problem of @ray-js/panel-sdk, you can first use 'npm install --legacy-peer-deps' or' yarn 'to install the dependency, we will update @ray-js/panel-sdk.

We upgraded @ray-js/panel-sdk, using version 1.10.2 to confirm.

:geek: :ugeek: :mrgreen: :roll: :lol: :idea: :arrow: LGTM

Post Reply