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

[6.0.0-beta.14][Trying to use vue-router and Tailwindcss 2.0 together]Module parse failed: Unexpected token (1:0) #2625

Closed
maverickchangithub opened this issue Nov 23, 2020 · 5 comments
Assignees

Comments

@maverickchangithub
Copy link

  • Laravel Mix Version: 6.0.0-beta.14 (npm list --depth=0)
  • Node Version (node -v): 14.8.0
  • NPM Version (npm -v): 6.14.8
  • OS: macOs High Sierra , valet php-7.4.9

Description:

for using Tailwindcss 2.0, i have to use beta 6.0.0-beta.14, but if i use vue-router , .vue file resolve failed

Module parse failed: Unexpected token (1:0)
You may need an appropriate loader to handle this file type, currently no loaders are configured to process this file. See https://webpack.js.org/concepts#loaders

Steps To Reproduce:

create a file called postcss.config.js under the root directory , and make the file like this

module.exports = {
  plugins: {
    tailwindcss: {},
    autoprefixer: {},
  }
}

. npm install
. npm run dev

@thecrypticace
Copy link
Collaborator

As I understand Vue SFCs doesn't work with PostCSS 8-only plugins yet. You can use the tailwind PostCSS 7 compatibility build to work around this (see: https://tailwindcss.com/docs/installation#post-css-7-compatibility-build)

@solamichealolawale
Copy link

solamichealolawale commented Nov 24, 2020

Okay I tried using the below command as seen in the link and I still experienced the same issue

npm uninstall tailwindcss postcss autoprefixer
npm install tailwindcss@npm:@tailwindcss/postcss7-compat postcss@^7 autoprefixer@^9

Until I downgrade the laravel mix verstion from 6.0 to "laravel-mix": "^5.0.1"

@thoresuenert
Copy link

thoresuenert commented Nov 25, 2020

With the new version and vue3 support built in, you need to specify wich vue version you want to use.
Otherwise the loader isn't configured correctly.

mix.js('src/app.js', 'dist').vue({ version: 2 });

See the docs: https://laravel-mix.com/docs/6.0/vue

@thecrypticace I guess you don't have support for <style> tags within Vue SFCs, the rest is working fine.

@donmbelembe
Copy link

mix.js('src/app.js', 'dist').vue();

@stale
Copy link

stale bot commented Jun 11, 2021

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.

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

5 participants