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

Don't create typings files for non-named imports #45

Open
fourpastmidnight opened this issue Jul 9, 2021 · 0 comments
Open

Don't create typings files for non-named imports #45

fourpastmidnight opened this issue Jul 9, 2021 · 0 comments

Comments

@fourpastmidnight
Copy link

I'm using Semantic UI React along with their Semantic UI CSS styles.

App.tsx:

import 'semantic-ui-css/semantic.min.css';
import './App.css'
import MyComponent from './components';

export const App = () => <MyComponent />

export default App;

In the code above, both CSS imports cause a <filename>.css.d.ts file to be created. But this is problematic for the semantic.min.css file because it's not my file. It's one provided by a NPM library. And I'm using a mono-repo with Yarn and PnPJS, so there is no node_modules folder, but a cache of ZIP files with a require.resolve hook/interceptor to provide module resolution for node--i.e. the "node_modules" filesystem is "read-only". And so this loader fails:

D:/src/git/my-project/.yarn/cache/semantic-ui-css-npm-2.4.1-488d289b03-51eb2d50e7.zip/node_modules/semantic-ui-css/semantic.min.css (D:/src/git/my-project/.yarn/$$virtual/css-loader-virtual-73afbc880bb/0/cache/css-loader-npm-4.3.0-33464197c9-1f441ac567.zip/node_modules/css-loader/dist/cjs.js??ref--5-oneOf-4-1!D:/src/git/my-project/.yarn/cache/css-modules-typescript-loader-npm-4.0.1-393a7cad32-5af2583d4a.zip/node_modules/css-modules-typescript-loader!D:/src/git/my-project/.yarn/cache/postcss-loader-npm-3.0.0-f4ab99b685-50b2d8892d.zip/node_modules/postcss-loader/src?postcss!D:/src/git/my-project/.yarn/cache/semantic-ui-css-npm-2.4.1-488d289b03-51e2d50e7.zip/node_modules/semantic-ui-css/semantic.min.css)
Error: EROFS: read-only filesystem, open '/node_modules/semantic-ui-css-semantic.min.css.d.ts'

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

1 participant