1

i have an issue. with my React app while i'm building for prod.

./src/styles/main.scss
ParserError: Syntax Error at line: 1, column 25

here's my main.scss file

@import 'vars/typography';
@import 'vars/fonts';
@import 'vars/colors';
@import 'vars/layout';
@import '~bootstrap/scss/bootstrap';
@import 'base.scss';
@import 'components/header';
@import 'components/navigation';
@import 'components/home';
@import 'components/section';
@import 'components/footer';

enter image description here

finally how i import the main.scss into my project

import React from 'react';
import ReactDOM from 'react-dom';
import App from './app/App';
import './styles/main.scss';

ReactDOM.render(
  <React.StrictMode>
      <App />
  </React.StrictMode>,
  document.getElementById('root'),
);

no matter the order i'm putting the imports, i always get the same error. I tried with ./ in front of the import with the same result

4
  • parse error means your build process doesn't know what to do with the .scss file format. Did you add node-scss? Run npm install node-sass --save to add it. Commented Sep 23, 2021 at 12:40
  • I do have sass but not node-sass specifically. I'll try when I can thanks Commented Sep 23, 2021 at 13:11
  • unfortunately i get the same error Commented Sep 24, 2021 at 0:11
  • I deleted sass and node-sass and i followed that link and it works stackoverflow.com/questions/51850093/… Commented Sep 24, 2021 at 0:19

1 Answer 1

1

Thanks to @dikuw for the answer. To wrap up, I deleted Sass and node-sass and I followed that link for cleaning and rebuilding the whole project.

ERROR in ./src/styles.scss .. Module build failed: Error: Cannot find module 'node-sass'

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

Comments

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.