styled-components / stylis-plugin-rtl

↔️ stylis RTL plugin based on CSSJanus
MIT License
37 stars 17 forks source link

Source-map file not found #35

Open mirismaili opened 2 years ago

mirismaili commented 2 years ago

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/stylis-plugin-rtl@2.1.1/ image


I use webpack@5.62.2.

aderchox commented 2 years ago

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

2. 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>
shadigaafar commented 2 years ago

I have the same problem, any solutions?

AbdullahElrubi commented 2 years ago

can you please provide a solution for this?

shadigaafar commented 2 years ago

can you please provide a solution for this?

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

AbdullahElrubi commented 2 years ago

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.

rhinck commented 2 years ago

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

SubJunk commented 2 years ago

Would be great to see this fixed

alidanial7 commented 2 years ago

same issue here

bambier commented 2 years ago

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

I have same issue too

Gallevy commented 1 year ago

Is this project not maintained? Same issue here

amirshnll commented 1 year ago

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

yarn remove stylis-plugin-rtl

npm uninstall stylis-plugin-rtl

secondly, install stylis-plugin-rtl@2.0.2 with npm or yarn:

yarn add stylis-plugin-rtl@2.0.2

npm i stylis-plugin-rtl@2.0.2
arobert93 commented 1 year ago

Any updates on this?

itayperry commented 1 year ago

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

Ahmed-Abdelftah commented 1 year ago

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

magrinj commented 1 year ago

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

dev-hub7 commented 1 year ago

any update?!!

AhmedelheGery commented 1 year ago

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

Here is how is my env looks like:

image

mohsenaahmadi commented 3 weeks ago

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.