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

Error when scss file is empty #327

Closed
gongpeione opened this issue Dec 18, 2017 · 9 comments
Closed

Error when scss file is empty #327

gongpeione opened this issue Dec 18, 2017 · 9 comments
Labels

Comments

@gongpeione
Copy link
Contributor

Choose one: is this a 🐛 bug report or 🙋 feature request?
🐛 bug report

🤔 Expected Behavior

Built successful

😯 Current Behavior

Build failed, No input specified: provide a file name a source string to process

💁 Possible Solution

pass a space when .scss file is empty

🔦 Context

I know scss file is not empty normally, but I think maybe it should not show an error message when it is empty. And I can create a pr if you want.

@nnnikolay
Copy link

I just took to play around with the latest version and I end up with not working HRM, apparently. When scss has been changed the process either stops or changes are not visible unless I refresh the page. It happens also if I make some big changes, for example, refactoring (incl. npm modules installation) from simple js file to react based 'hello world'. Complete re-run npm start helps though.

@davidnagli
Copy link
Contributor

@nnnikolay I’m not really understanding how that applies to this issue...

@gongpeione Wow great catch! This definetly needs to get fixed. Can you please make a PR?

@nnnikolay
Copy link

nnnikolay commented Dec 18, 2017

@davidnagli sorry if it's not, I just started with an empty file as well, and then almost every file creation, module installation etc... leads me to the Error, I thought it might be connected. But later I've found more relevant #315. Sorry.

@brandon93s
Copy link
Contributor

Is there a valid use case for an empty sass file, or are we solving for an edge case here?

@davidnagli
Copy link
Contributor

davidnagli commented Dec 19, 2017

@brandon93s Looks like an edge case 🐳

@rondonjon
Copy link

rondonjon commented Dec 20, 2017

@brandon93s it is definitely a bug. An importer should be able to handle empty files unless empty files are invalid by the file type specification.

it may be an edge case in daily development, but considering the trouble that it causes and the little effort that it takes to solve it, I would definitely take the change. If this helps 50 people each save 30 minutes of pointless debugging, it's worth it.

And since it is a bug, what is the alternative. Add an info to the docs that one particular loader in parcel can't deal with empty files, so please don't do that?

@brandon93s
Copy link
Contributor

I don't disagree, I just think this should be solved to handle all empty assets. The proposed solution fixed SASS only. I support empty asset handling at a higher level.

@gongpeione
Copy link
Contributor Author

Yes, I agree empty files should be handling at a higher level.

devongovett pushed a commit that referenced this issue Dec 30, 2017
* Fix: Error when scss file is empty #327

* Return empty string when code is empty

* Handling empty files

* No need to load in mightHaveDependencies()

* mightHaveDependencies doesn't run if this.contents is empty.
@devongovett
Copy link
Member

Closing. Should be fixed by #340.

devongovett pushed a commit that referenced this issue Oct 15, 2018
* Fix: Error when scss file is empty #327

* Return empty string when code is empty

* Handling empty files

* No need to load in mightHaveDependencies()

* mightHaveDependencies doesn't run if this.contents is empty.
devongovett pushed a commit that referenced this issue Oct 15, 2018
* Fix: Error when scss file is empty #327

* Return empty string when code is empty

* Handling empty files

* No need to load in mightHaveDependencies()

* mightHaveDependencies doesn't run if this.contents is empty.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

6 participants