question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

<style> in Vue component is unexpectly removed in Laravel Mix v6.0.16

See original GitHub issue
  • Laravel Mix Version: 6.0.16 (npm list --depth=0)
  • Node Version (node -v): v14.15.4
  • NPM Version (npm -v): v6.14.11

Description:

In Laravel Mix v6.0.16, the CSS within <style> in a Vue component isn’t included in the built stylesheet.

See this Gist as an example: https://gist.github.com/danielbachhuber/5a8b8d6b74072a9da9d5f83dda3f722a

The CSS within <style> is included as expected in Laravel Mix v6.0.13.

Issue Analytics

  • State:closed
  • Created 2 years ago
  • Reactions:6
  • Comments:30 (2 by maintainers)

github_iconTop GitHub Comments

3reactions
maxxschocommented, Apr 16, 2021

Same here. Updating from 6.0.13 to 6.0.16 and my styles from Vue Single File components are gone. extractStyle: true|false doesn’t have an effect.

1reaction
thecrypticacecommented, Jun 11, 2021

@danielbachhuber Right.

It allows Vue SFC styles in the shadow dom + some other stuff detailed in the readme: https://github.com/vuejs/vue-style-loader#readme

Read more comments on GitHub >

github_iconTop Results From Across the Web

<style> in Vue component is unexpectly removed in Laravel ...
Description: In Laravel Mix v6.0.16, the CSS within <style> in a Vue component isn't included in the built stylesheet.
Read more >
apply not working inside Vue component in Laravel Mix
It seems this may be a bug in Laravel Mix, see this issue. Try adding the following to your Mix config (source):
Read more >
Vue | Laravel Mix Documentation
Basic Usage. Mix ships with support for both Vue 2 and Vue 3 single file components. ... script, and styling within a single...
Read more >
Extracting Style CSS From Vue Components - Laracasts
I seem to recall there was a Mix or Webpack plugin that will extract those style chunks from each component into it's own...
Read more >
Asset Bundling (Vite) - The PHP Framework For Web Artisans
Vite has replaced Laravel Mix in new Laravel installations. ... You must ensure that Node.js (16+) and NPM are installed before running Vite...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found