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

Type issue when used with TypeScript #3

Open
umarmw opened this issue Jan 21, 2020 · 4 comments
Open

Type issue when used with TypeScript #3

umarmw opened this issue Jan 21, 2020 · 4 comments

Comments

@umarmw
Copy link

umarmw commented Jan 21, 2020

Hello,
I ran into this error when using the plugin with TypeScript on a CRA project.

Could not find a declaration file for module 'stylis-plugin-rtl'. '/Users/umar/Documents/AzureDevOps/components/node_modules/stylis-plugin-rtl/dist/stylis-rtl.js' implicitly has an 'any' type.
Try npm install @types/stylis-plugin-rtl if it exists or add a new declaration (.d.ts) file containing declare module 'stylis-plugin-rtl';ts(7016)

@iassainov
Copy link

@umarmw There is probably no typescript definitions for this package yet.

To remove the error, create typings.d.ts inside src directory, and add the following in there:

declare module 'stylis-plugin-rtl' {
	const noTypesYet: any;
	export default noTypesYet;
}

@Shaker-Hamdi
Copy link

@umarmw There is probably no typescript definitions for this package yet.

To remove the error, create typings.d.ts inside src directory, and add the following in there:

declare module 'stylis-plugin-rtl' {
	const noTypesYet: any;
	export default noTypesYet;
}

Even after I did that, it gave me this error ...

Unhandled Runtime Error
TypeError: Cannot create property 'return' on number '-1'

What did you do to get it to work properly?

@Shaker-Hamdi
Copy link

I want to add that this issue only happens in Version 2, when I downgraded to Version 1 it works with no problem.

@hamidsaif70
Copy link

hi there. i get this error with stylis-plugin-rtl

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 '/home/hamid/Desktop/zahra-wieb-shop/node_modules/stylis-plugin-rtl/src/stylis-rtl.ts' file: Error: ENOENT: no such file or directory, open '/home/hamid/Desktop/zahra-wieb-shop/node_modules/stylis-plugin-rtl/src/stylis-rtl.ts'
@ ./src/index.js 8:0-42 15:18-27

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

No branches or pull requests

4 participants