1

Help me please. Added Nuxt(SSR) to the my vue project. All moved to the root of the project, created a page folder. The following error appeared:

 ERROR in ./.nuxt/components/nuxt-loading.vue?vue&type=style&index=0&lang=css& (./node_modules/css-loader/dist/cjs.js??ref--3-oneOf-1-1!./node_modules/vue-loader/lib/loaders/stylePostLoader.js!./node_modules/postcss-loader/src??ref--3-oneOf-1-2!./node_modules/vue-loader/lib??vue-loader-options!./.nuxt/components/nuxt-loading.vue?vue&type=style&index=0&lang=css&)
    Module build failed (from ./node_modules/css-loader/dist/cjs.js):
    ValidationError: Invalid options object. CSS Loader has been initialized using an options object that does not match the API schema.
     - options.modules has an unknown property 'compileType'. These properties are valid:
       object { auto?, mode?, exportGlobals?, localIdentName?, localIdentRegExp?, context?, hashPrefix?, getLocalIdent? }
        at validate (/app/node_modules/css-loader/node_modules/schema-utils/dist/validate.js:98:11)
        at Object.loader (/app/node_modules/css-loader/dist/index.js:36:28)
     @ ./.nuxt/components/nuxt-loading.vue?vue&type=style&index=0&lang=css& (./node_modules/vue-style-loader??ref--3-oneOf-1-0!./node_modules/css-loader/dist/cjs.js??ref--3-oneOf-1-1!./node_modules/vue-loader/lib/loaders/stylePostLoader.js!./node_modules/postcss-loader/src??ref--3-oneOf-1-2!./node_modules/vue-loader/lib??vue-loader-options!./.nuxt/components/nuxt-loading.vue?vue&type=style&index=0&lang=css&) 4:14-327
     @ ./.nuxt/components/nuxt-loading.vue?vue&type=style&index=0&lang=css&
     @ ./.nuxt/components/nuxt-loading.vue
     @ ./.nuxt/App.js
     @ ./.nuxt/index.js
     @ ./.nuxt/client.js
     @ multi ./.nuxt/client.js

enter image description here

code from nuxt.config.js:

import { resolve } from 'path'

export default {
  alias: {
    style: resolve(__dirname, './assets/style'),
  },
}

As I understand the error is related to the setting of the Nuxt.

5

1 Answer 1

2

In your package.json you do have sass-loader set to ^12.1.0, meanwhile the package introduces a breaking change during v11.0.0.

It requires Webpack5, which Nuxt is not compatible as of today. If you downgrade it down to v10.1.1 (and all related packages like node-sass), you should be fine.

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

1 Comment

it's work! Thank you! Here's what I did (I installed sass and css loader, which support webpack4 ): 1) yarn remove node-sass sass-loader css-loader 2) yarn add [email protected] 3) yarn add [email protected] -D 4) yarn add [email protected] -D

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.