7

So as I say in the title I'm having a simple index.html file that has a <link rel="stylesheet" href="./styles/styles.scss"> to import my styles. When I run the parcel index.html I get an error that says .nvm/versions/node/v10.16.3/lib/node_modules/parcel-bundler/src/builtins/css-loader.js: JSON5: invalid character '}' at 1:23. Here is my css in case you want to take a look at it:

body {
   margin: 0;
   padding: 0;
   box-sizing: border-box;
}

I'm using the parcel-bundler without any configuration and even the first example from the get started page of the Parcel website can't run without throwing out an error about an invalid character.

If I remove the css import then the project builds. Node is on version 10.16.3 and npm is 6.9.0

I've tried using a lower node version but I'm getting the same issue.

J. Stott
  • 166
  • 14
captain
  • 1,597
  • 4
  • 17
  • 29
  • Why are you on Node 10? The current LTS is v14. Also, slightly more related to your problem, why does your HTML have a link for an `scss` file instead of a `css` file? – Mike 'Pomax' Kamermans Mar 11 '21 at 15:47

2 Answers2

2

I have had like your Error but like this :

invalid Version :

/node_modules/parcel-bundler/src/builtins/css-loader.js: JSON5: invalid Version ..

so what I did .. I made uninstall to parcel then I used an older version then It has worked successfully ..

I have used parcel@1.12.3 instead of parcel@1.12.4

zahra zamani
  • 839
  • 3
  • 12
0

I had a blank .babelrc in my root folder. Deleted it fixed the problem for me

nemo
  • 49
  • 8