Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Source-map file not found #35

Open
mirismaili opened this issue Jan 19, 2022 · 17 comments
Open

Source-map file not found #35

mirismaili opened this issue Jan 19, 2022 · 17 comments

Comments

@mirismaili
Copy link

mirismaili commented Jan 19, 2022

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
Copy link

aderchox commented Feb 1, 2022

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>

@shadigaafar
Copy link

I have the same problem, any solutions?

@AbdullahElrubi
Copy link

can you please provide a solution for this?

@shadigaafar
Copy link

shadigaafar commented Jun 3, 2022

can you please provide a solution for this?

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

@AbdullahElrubi
Copy link

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
Copy link

rhinck commented Jun 11, 2022

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
Copy link

SubJunk commented Jun 25, 2022

Would be great to see this fixed

@alidanial7
Copy link

same issue here

@bambier
Copy link

bambier commented Jul 16, 2022

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

I have same issue too

@Gallevy
Copy link

Gallevy commented Sep 13, 2022

Is this project not maintained? Same issue here

@amirshnll
Copy link

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
Copy link

Any updates on this?

@itayperry
Copy link

itayperry commented Feb 27, 2023

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
Copy link

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

@magrinj
Copy link

magrinj commented Mar 7, 2023

You can take a look at my comment here: #33 (comment)

@dev-hub7
Copy link

any update?!!

@AhmedelheGery
Copy link

AhmedelheGery commented May 17, 2023

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.