elmarti / react-joystick-component

Tiny, multitouch, component driven joysticks in react
MIT License
86 stars 27 forks source link

Yarn warnings but working fine #39

Closed swarner1033 closed 1 year ago

swarner1033 commented 2 years ago

Describe the bug Getting warnings when I yarn start joystick. It seems to be working just fine though.

Compiled with warnings.

Failed to parse source map from '{path to my repo}/node_modules/react-joystick-component/src/Joystick.tsx' file: Error: ENOENT: no such file or directory, open '{path to my repo}/node_modules/react-joystick-component/src/Joystick.tsx'

Failed to parse source map from '{path to my repo}/node_modules/react-joystick-component/src/enums/shape.enum.ts' file: Error: ENOENT: no such file or directory, open '{path to my repo}/node_modules/react-joystick-component/src/enums/shape.enum.ts'

Failed to parse source map from '{path to my repo}/node_modules/react-joystick-component/src/shapes/shape.bounds.factory.ts' file: Error: ENOENT: no such file or directory, open '{path to my repo}/node_modules/react-joystick-component/src/shapes/shape.bounds.factory.ts'

Failed to parse source map from '{path to my repo}/node_modules/react-joystick-component/src/shapes/shape.factory.ts' file: Error: ENOENT: no such file or directory, open '{path to my repo}/node_modules/react-joystick-component/src/shapes/shape.factory.ts'

To Reproduce Steps to reproduce the behavior:

import { Box, Typography } from "@mui/material"
import { IJoystickUpdateEvent, Joystick } from "react-joystick-component/build/lib/Joystick"

const handleMove = (event: IJoystickUpdateEvent) => {
    console.log(event)
}

const JoystickBox: React.FC = () => (
    <Box>
        <Typography variant="h4">Steering</Typography>
        <Joystick move={handleMove} size={300}></Joystick>
    </Box>
)

export default JoystickBox
{
  "name": "project name",
  "version": "0.1.0",
  "private": true,
  "dependencies": {
    "@emotion/react": "^11.8.1",
    "@emotion/styled": "^11.8.1",
    "@fontsource/roboto": "^4.5.3",
    "@mui/material": "^5.4.3",
    "@types/node": "^16.7.13",
    "@types/react": "^17.0.20",
    "@types/react-dom": "^17.0.9",
    "react": "^17.0.2",
    "react-dial-knob": "^1.3.0",
    "react-dom": "^17.0.2",
    "react-joystick-component": "^4.1.0",
    "react-scripts": "5.0.0",
    "react-triple-toggle-switch": "^1.0.3",
    "typescript": "^4.4.2"
  },
  "scripts": {
    "start": "react-scripts start",
    "build": "react-scripts build",
    "eject": "react-scripts eject"
  },
  "eslintConfig": {
    "extends": [
      "react-app"
    ]
  },
  "browserslist": {
    "production": [
      ">0.2%",
      "not dead",
      "not op_mini all"
    ],
    "development": [
      "last 1 chrome version",
      "last 1 firefox version",
      "last 1 safari version"
    ]
  }
}

Expected behavior No warnings

Desktop (please complete the following information):

Bilal-chaf commented 2 years ago

Hi,

I have exactly the same warnings with "react-scripts": "5.0.0", it uses webpack 5.69.1. Warnings may appear when using the latest version of react scripts. I had never seen these warnings before (on 4.xx versions of react-scripts).

Greetings,

Bilal

elmarti commented 1 year ago

Added a potential fix for this - including the src in the package - it looks like your bundler is trying to resolve them and failing.. This should hopefully resolve it