stylis-plugin-rtl icon indicating copy to clipboard operation
stylis-plugin-rtl copied to clipboard

stylis-plugin-rtl + source-map-loader = breakage

Open Bnaya opened this issue 3 years ago • 36 comments

The built source files and the sourcemaps of the library contains reference to the src/ directory:

{"version":3,"file":"stylis-rtl.js","sourceRoot":"","sources":["../src/stylis-rtl.ts"],"names":[]

But the actual src directory is not shipped with the package, thus ../src/stylis-rtl.ts does not exist. When using source-map-loader ( as with create react app 5), the build fails as it can't file stylis-rtl.ts

Possible solutions:

  • Use inline source-maps
  • Don't generate source-maps
  • ship src as well

Bnaya avatar Dec 09 '21 16:12 Bnaya

I am getting the same warning as well as shown below:

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 '...\node_modules\stylis-plugin-rtl\src\stylis-rtl.ts' file: Error: ENOENT: no such file or directory, open '...\node_modules\stylis-plugin-rtl\src\stylis-rtl.ts' @ ./src/contexts/ThemeContext.js 9:0-42 22:18-27 @ ./src/index.js 13:0-63 17:61-81

fadijabi avatar Dec 18 '21 21:12 fadijabi

@fadijabi I have the same problem 🥲

mortezasabihi avatar Dec 31 '21 14:12 mortezasabihi

the same too

hamidsaif70 avatar Jan 15 '22 11:01 hamidsaif70

same error here...

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 '...node_modules/stylis-plugin-rtl/src/stylis-rtl.ts' file: Error: ENOENT: no such file or directory, open '../node_modules/stylis-plugin-rtl/src/stylis-rtl.ts'
 @ ./src/components/RtlLayout.tsx 4:0-42 22:48-57
 @ ./src/App.tsx 8:0-47 18:37-46
 @ ./src/index.tsx 15:0-24 22:39-42

chrisk8er avatar Jan 21 '22 01:01 chrisk8er

I also have same problem

shineysood avatar Jan 23 '22 11:01 shineysood

the same too

hadarhubara10 avatar Jan 25 '22 22:01 hadarhubara10

Same here

NicoSan20 avatar Jan 30 '22 21:01 NicoSan20

Getting the same

or-yam avatar Jan 31 '22 10:01 or-yam

I also have same problem

amirgholikhani avatar Jan 31 '22 13:01 amirgholikhani

same here. I forked a repo and ran npm install and npm start and then got this error. What can I do to get rid of it?

goerlitz avatar Feb 12 '22 21:02 goerlitz

Was also having this issue. I know it's not the best solution, but I was able to avoid these errors/warnings by reverting to stylis-plugin-rtl v1.

gucollaco avatar Feb 13 '22 17:02 gucollaco

I have the same problem. Any Solutions?

shadigaafar avatar Feb 20 '22 08:02 shadigaafar

npm i [email protected] solved for me...

egbertn avatar Feb 25 '22 18:02 egbertn

is there any update on this issue? could someone find a solution except downgrading to previous versions (v1 and v2.0.2 and ...)

SaeedZhiany avatar Apr 25 '22 18:04 SaeedZhiany

The same problem v.2.1.1

lordlpua avatar Jul 19 '22 11:07 lordlpua

I have same problem on v.2.1.1 Any Solutions?

perfeshnal avatar Jul 28 '22 14:07 perfeshnal

I have this error in my React project as well and would love to hear if anyone has the issue and has resolved it.

rhinck avatar Aug 04 '22 16:08 rhinck

I have the same problem, any update

mlotfy avatar Aug 22 '22 13:08 mlotfy

I am having the same problem since a long time, any updates please?

ahamdan-ow avatar Aug 25 '22 05:08 ahamdan-ow

you can try to solve this warning with below steps. for me its working

  1. create .env file on root
  2. add this line : GENERATE_SOURCEMAP=false

Thats it !! re-run the project.

wrappixel avatar Aug 31 '22 11:08 wrappixel

I have same problem on v.2.1.1 Any Solutions?

arshak-grigoryan avatar Sep 13 '22 17:09 arshak-grigoryan

I have the same problem, on v.2.1.1

amirvokhidov avatar Nov 02 '22 13:11 amirvokhidov

firstly, remove or uninstall stylis-plugin-rtl with npm or yarn:

yarn remove stylis-plugin-rtl

npm uninstall stylis-plugin-rtl

secondly, install [email protected] with npm or yarn:

yarn add [email protected]

npm i [email protected]

amirshnll avatar Nov 27 '22 20:11 amirshnll

firstly, remove or uninstall stylis-plugin-rtl with npm or yarn:

yarn remove stylis-plugin-rtl

npm uninstall stylis-plugin-rtl

secondly, install [email protected] with npm or yarn:

yarn add [email protected]

npm i [email protected]

That works for me.

bienvenuelisis avatar Nov 29 '22 09:11 bienvenuelisis

firstly, remove or uninstall stylis-plugin-rtl with npm or yarn:

yarn remove stylis-plugin-rtl

npm uninstall stylis-plugin-rtl

secondly, install [email protected] with npm or yarn:

yarn add [email protected]

npm i [email protected]

Maybe your solution will work But I think going back to the old version is not a real solution We still waiting ...

perfeshnal avatar Dec 01 '22 08:12 perfeshnal

I have the same issue here... Is there a scheduled solution in the roadmap?

hugrave avatar Jan 13 '23 15:01 hugrave

It is because the .ts file is not supplied in dist or src. Placing it there manually will fix it

barrychapman avatar Jan 18 '23 15:01 barrychapman

Seems this community is missing contributors, a year old issue is still open, and faced by many including me, I think they just need to publish the package without source map generated, would solve this problem for now.

hitendramalviya avatar Jan 30 '23 19:01 hitendramalviya

Is this the same issue as #35?

itayperry avatar Feb 27 '23 17:02 itayperry

Seems this community is missing contributors, a year old issue is still open, and faced by many including me, I think they just need to publish the package without source map generated, would solve this problem for now.

Yeah it seems the last commit was on Dec 15, 2021 :( @hitendramalviya

itayperry avatar Feb 27 '23 17:02 itayperry