sveltejs / sapper-template

Starter template for Sapper apps
703 stars 214 forks source link

Service worker warns: No directory provided. Skipping CSS generation #298

Closed mattpilott closed 3 years ago

mattpilott commented 3 years ago

Been seeing this warning lately, not sure what has led to it

Screenshot 2021-01-23 at 2 06 58 pm

Presumably it's something that can be resolved in the rollup config

gustavopch commented 3 years ago

Relevant changes that I found:

The message started to appear since sapper@0.29.0.

yashsamit commented 3 years ago

Any idea how to fix it?

jessaleks commented 3 years ago

Been seeing this warning lately, not sure what has led to it

Screenshot 2021-01-23 at 2 06 58 pm

Presumably it's something that can be resolved in the rollup config

but where 🤔

Pytal commented 3 years ago

I hid the warning message by adding this line into the onwarn function of rollup.config.js

  (warning.plugin === 'css' && warning.message === 'No directory provided. Skipping CSS generation') ||

Full onwarn function:

const onwarn = (warning, onwarn) =>
  (warning.code === 'MISSING_EXPORT' && /'preload'/.test(warning.message)) ||
  (warning.code === 'CIRCULAR_DEPENDENCY' && /[/\\]@sapper[/\\]/.test(warning.message)) ||
  (warning.code === 'THIS_IS_UNDEFINED') ||
  (warning.plugin === 'css' && warning.message === 'No directory provided. Skipping CSS generation') ||
  onwarn(warning)
yashsamit commented 3 years ago

We should identify and remove the problem. This is not a good idea. I think :)

didiermun commented 3 years ago

We should identify and remove the problem. This is not a good idea. I think :)

yeah sure. I would like also to get on that solution on that problem.

didiermun commented 3 years ago

Been seeing this warning lately, not sure what has led to it Screenshot 2021-01-23 at 2 06 58 pm Presumably it's something that can be resolved in the rollup config

but where 🤔

when you are running the sapper project it will

tri-nga commented 3 years ago

Hi, I just updated Sapper to 0.29.1 and I get this message No directory provided. Skipping CSS generation, as in the screenshots above.

What's the issue and.. how could I fix that ?

babichjacob commented 3 years ago

Hi, I just updated Sapper to 0.29.1 and I get this message No directory provided. Skipping CSS generation, as in the screenshots above.

What's the issue and.. how could I fix that ?

[Disclaimer: I did not test to see if the latest version of the Sapper template still results in this warning]

If you aren't using the latest version of this Sapper template, then your config hasn't been updated to avoid the warning. So, start over using the latest version of the template or compare its config files and dependencies to yours to see if you can solve the error without starting over.

tri-nga commented 3 years ago

Hi, I just updated Sapper to 0.29.1 and I get this message No directory provided. Skipping CSS generation, as in the screenshots above. What's the issue and.. how could I fix that ?

[Disclaimer: I did not test to see if the latest version of the Sapper template still results in this warning]

If you aren't using the latest version of this Sapper template, then your config hasn't been updated to avoid the warning. So, start over using the latest version of the template or compare its config files and dependencies to yours to see if you can solve the error without starting over.

The message No directory provided. Skipping CSS generation showed up after I updated the packages to the latest version available. I did solve going "back" to the Sapper template packages version.

working

silllli commented 3 years ago

A fix has been merged to the master branch, but hasn’t been released yet. To get Sapper with the latest commits (even if not part of a tagged version) you can install it directly from the master branch on GitHub: npm install -D sveltejs/sapper#master