3

I am trying to include a scss file in the css nuxt.config.js option however when I run

npm run dev

I get the following error :

This dependency was not found:

* ..\assets\css\main.scss in ./.nuxt/App.js

To install it, you can run: npm install --save ..\assets\css\main.scss

Here is my package.json :

  "dependencies": {
    "bootstrap-vue": "^2.0.0-rc.11",
    "nuxt": "^1.0.0"
  },
  "devDependencies": {
    "babel-eslint": "^8.2.1",
    "eslint": "^4.15.0",
    "eslint-friendly-formatter": "^3.0.0",
    "eslint-loader": "^1.7.1",
    "eslint-plugin-vue": "^4.0.0",
    "node-sass": "^4.9.2",
    "sass-loader": "^7.1.0"
  }

And the css configuration :

css: [
    "@/assets/css/main.scss",
  ],

The main.scss file is located under assets/css/main.scss :

@import "node_modules/bootstrap/scss/bootstrap";

* {
  font-family: "Quicksand";
  margin: 0;
  padding: 0;
}

.full-width {
  width: 100%;
}
1
  • Can you post your whole config file? It may be you are missing a curly brace or something. Commented Aug 7, 2018 at 21:36

1 Answer 1

6

As the docs points out, verify that you installed sass-loader, sass and fibers (npm packages).

npm install --save-dev sass sass-loader fibers

verify url path and check whether the file exists in the specified url

css: [
    '@/assets/scss/main.scss'
]

you could use style-resources-module

refer here

Sign up to request clarification or add additional context in comments.

1 Comment

This solution didnt work for me, i still get the error

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.