6

I'm trying to add a react material template to my reactJs Project. I fix all the errors but I can't fix this one

WARNING in ./node_modules/stylis-plugin-rtl/dist/stylis-rtl.js
Module Warning (from ./node_modules/source-map-loader/dist/cjs.js):
Failed to parse source map from 'C:\Users\syrine\management\node_modules\stylis-plugin-rtl\src\stylis-rtl.ts' file: Error: ENOENT: no such file or directory, open 'C:\Users\syrine\management\node_modules\stylis-plugin-rtl\src\stylis-rtl.ts'
 @ ./src/App.js 39:0-42 74:22-31
 @ ./src/index.js 22:0-22 28:35-38

1 warning has detailed information that is not shown.
Use 'stats.errorDetails: true' resp. '--stats-error-details' to show it.

webpack 5.67.0 compiled with 1 warning in 22425 ms

I will be very thankful if you can help me fixing this issue

3 Answers3

15

Try this:

npm i stylis-plugin-rtl@2.0.2

Solved for me

Vu Xuan Thu
  • 314
  • 1
  • 4
2

Adding .env at the root of your project and adding this line to your env file GENERATE_SOURCEMAP=false will solve the problem.

Taken from https://github.com/styled-components/stylis-plugin-rtl/issues/33#issuecomment-1232840477

Asplund
  • 2,254
  • 1
  • 8
  • 19
Turay Musa
  • 21
  • 1
0

If downgrading to version 2.0.2 of the stylis-plugin-rtl package didn't work for you, there is an alternative solution you can try.

To implement this solution, follow these steps:

Open the stylis-rtl.d.ts file located in the node_modules/stylis-plugin-rtl/types directory.

Replace the entire content of the file with the following code:

import { Middleware } from 'stylis';

declare type MiddlewareParams = Parameters<Middleware>;

declare function stylisRTLPlugin(
  element: MiddlewareParams[0],
  index: MiddlewareParams[1],
  children: MiddlewareParams[2],
  callback: MiddlewareParams[3]
): string | void;

export default stylisRTLPlugin;

Save the changes. By applying this modification, you should be able to resolve the issue you encountered with the stylis-plugin-rtl package.

Note: The credit for this solution goes to the user who posted it on GitHub. You can find the original discussion and solution at the following link: https://github.com/styled-components/stylis-plugin-rtl/issues/33

Moshe Fortgang
  • 711
  • 4
  • 18