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

Source-map file not found

Open mirismaili opened this issue 3 years ago • 20 comments

I get this warning during Webpack build:

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'

It expects to find the source-map file in the src folder. But it hasn't been published on NPM.

https://unpkg.com/browse/[email protected]/ image


I use [email protected].

mirismaili avatar Jan 19 '22 21:01 mirismaili

The same issue 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 'D:\vah\projects\SAJ\node_modules\stylis-plugin-rtl\src\stylis-rtl.ts' file: Error: ENOENT: no such file or directory, open 'D:\vah\projects\SAJ\node_modules\stylis-plugin-rtl\src\stylis-rtl.ts'
 @ ./src/layouts/RTL.js 4:0-42 11:18-27
 @ ./src/App.js 9:0-32 13:30-33
 @ ./src/index.js 5:0-24 9:29-32

Steps to reproduce: 1.

npm install stylis stylis-plugin-rtl

Make RTL component like below:

import rtlPlugin from 'stylis-plugin-rtl';
import { CacheProvider } from '@emotion/react';
import createCache from '@emotion/cache';

// Create rtl cache
const cacheRtl = createCache({
  key: 'muirtl',
  stylisPlugins: [rtlPlugin],
});

export default function RTL(props) {
  return <CacheProvider value={cacheRtl}>{props.children}</CacheProvider>;
}
  1. Wrap the root of my project with the RTL component:
    <RTL>
      <ThemeProvider>
          <...>
      </ThemeProvider>
    </RTL>

aderchox avatar Feb 01 '22 07:02 aderchox

I have the same problem, any solutions?

shadigaafar avatar Feb 20 '22 14:02 shadigaafar

can you please provide a solution for this?

AbdullahElrubi avatar Jun 02 '22 15:06 AbdullahElrubi

can you please provide a solution for this?

In my case, I downgraded the version and it worked.

shadigaafar avatar Jun 03 '22 00:06 shadigaafar

can you please provide a solution for this?

In my case, I downgraded the version and it worked.

I understand that, but in the version you installed what is the difference between it and this new version that made it without source-map files? If so I can open a PR for this to be fixed.

AbdullahElrubi avatar Jun 03 '22 08:06 AbdullahElrubi

I'm experiencing the same issue and was also wondering how to fix it without needing to downgrade (causes other issues in my project).

rhinck avatar Jun 11 '22 04:06 rhinck

Would be great to see this fixed

SubJunk avatar Jun 25 '22 22:06 SubJunk

same issue here

alidanial7 avatar Jul 13 '22 04:07 alidanial7

Screenshot from 2022-07-16 20-42-11

I have same issue too

bambier avatar Jul 16 '22 16:07 bambier

Is this project not maintained? Same issue here

Gallevy avatar Sep 13 '22 20:09 Gallevy

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

Any updates on this?

acomanescu avatar Feb 16 '23 23:02 acomanescu

This package is relatively famous:

image

I hope it will be solved :) It'll help a lot of developers.

I'm having the same issue on pnpm with turborepo after installing "stylis-plugin-rtl": "^2.1.1":

image

itayperry avatar Feb 27 '23 17:02 itayperry

Really shit , we are in 2023 and this type of problems still exist ?!!

Ahmed-Abdelftah avatar Mar 05 '23 11:03 Ahmed-Abdelftah

You can take a look at my comment here: https://github.com/styled-components/stylis-plugin-rtl/issues/33#issuecomment-1458148783

magrinj avatar Mar 07 '23 13:03 magrinj

any update?!!

dev-hub7 avatar May 13 '23 10:05 dev-hub7

I found a fix for it and it worked for me:

  • remove node modules
  • npm install
  • add .env file beside src folder and add this line to it: GENERATE_SOURCEMAP=false
  • npm start

Here is how is my env looks like:

image

AhmedelheGery avatar May 17 '23 07:05 AhmedelheGery

I found a fix for it and it worked for me:

* remove node modules

* npm install

* add .env file beside **src** folder and add this line to it: GENERATE_SOURCEMAP=false

* npm start

Here is how is my env looks like:

image

Great. Thanks to you brother.

mohsenaahmadi avatar Jun 27 '24 17:06 mohsenaahmadi

add .env file beside src folder and add this line to it: GENERATE_SOURCEMAP=false npm start

Eli-Imran avatar Sep 07 '24 14:09 Eli-Imran