iannbing / react-simple-tree-menu

A simple React tree menu component
MIT License
137 stars 48 forks source link

Failed to parse source map when compiling with new version of react-scripts #200

Closed alexandraschlueter closed 1 year ago

alexandraschlueter commented 2 years ago

Hi, I was using your component in one of my projects and got to the following issue: If I use an older version of react and react-scripts (and therefore an older version of webpack, too), everything is compiling fine. But if i compile the app with webpack 5.68.0 (react 17.0.2, react-scripts 5.0.0) I am getting the following warning:

WARNING in ./node_modules/react-simple-tree-menu/dist/main.css (./node_modules/css-loader/dist/cjs.js??ruleSet[1].rules[1].oneOf[5].use[1]!./node_modules/postcss-loader/dist/cjs.js??ruleSet[1].rules[1].oneOf[5].use[2]!./node_modules/source-map-loader/dist/cjs.js!./node_modules/react-simple-tree-menu/dist/main.css) Module Warning (from ./node_modules/source-map-loader/dist/cjs.js): Failed to parse source map from 'C:\Users...myPath...\node_modules\react-simple-tree-menu\src\sass\main.scss' file: Error: ENOENT: no such file or directory, open 'C:\Users...myPath...\node_modules\react-simple-tree-menu\src\sass\main.scss'

When setting "GENERATE_SOURCEMAP=false" in the .env file the warning disappears, but I think this is not the best solution. Also, downgrading all of my other dependencies is not an option. Do you know if there is another possibility to deal with this, or will there be a newer version of the component without this issue? I'm not sure whether the problem is in my application or in your component, and I don't know exactly what needs to be done to fix this, so I am not able to open a pull request on this topic myself.

Thank you! :)

Alquemist commented 1 year ago

Same question. ...node_modules\react-simple-tree-menu\src\sass\main.scss' file: Error: ENOENT: no such file or directory,

iannbing commented 1 year ago

Hi @alexandraschlueter @Alquemist, sorry for the late reply. You can use the following path instead:

import 'react-simple-tree-menu/dist/main.css'