egoist / egoist/rollup-plugin-postcss

Error: File to import not found or unreadable

Open
#364 2 comments 0 reactions 0 assignees View on GitHub
Dominant language
JavaScript
Stars
689
Forks
210
PR merge metrics
No merged PRs in 30d

Description

Hi there,

Experiencing and intermittent issue wherein I cannot import a file directly after I save it with watch enabled. The error appears as follows.

```
[!] (plugin postcss) Error: File to import not found or unreadable: components/carousel.scss.
src\scss\stylesheet.scss
Error: File to import not found or unreadable: components/carousel.scss.
at options.error (...\node_modules\node-sass\lib\index.js:291:26)
```

However I can seem to trick this by saving the file a few times, or elsewise moving to the main `stylesheet.scss` file and saving it with no changes. File structure and configuration is like the following (omitted `reset.scss`).

![image](https://user-images.githubusercontent.com/49461152/114327489-9d2aa600-9b7c-11eb-8f10-bd87b7f4673a.png)

```scss
// stylesheet.scss
@import "components.scss";
```
```scss
// components.scss
@import "components/nav.scss";
@import "components/carousel.scss";
```
```js
// rollup.config.js
const path = require("path");

import postcss from "rollup-plugin-postcss";

export default {
input: "src/main.js",
output: {
file: "dist/bundle.js",
format: "cjs",
plugins: [],
},
watch: {
exclude: ["node_modules/**"],
},
plugins: [
postcss({
plugins: [],
extract: true,
}),
],
};
```

Am I clearly missing something in regards to file permissions or the like? Didn't see much difference running VSCode/Powershell as an administrator.

Contributor guide

No contributing guide indexed for this repository

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.