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

Expected semicolon or closing curly-brace, found '-' #306

Closed
davidliang2008 opened this issue Oct 30, 2017 · 14 comments
Closed

Expected semicolon or closing curly-brace, found '-' #306

davidliang2008 opened this issue Oct 30, 2017 · 14 comments

Comments

@davidliang2008
Copy link

davidliang2008 commented Oct 30, 2017

Installed product versions

  • Visual Studio: [2017 Community 15.4.1]
  • This extension: [2.6.362]

Description

I've been using web compiler to transform .scss files into css files, and the bundler to move and bundle css files into wwwroot directory.

Issue 1:
I noticed this version of the bundler won't minify the files automatically, like what the previous version 2.5.357 would do, but I think I can do that via settings so I didn't bother to look into this any deeper.

Issue 2:
Everything worked fine until I enable bundle on build, which downloaded 2 NuGet packages: BuildBundlerMinifier (2.6.362) and BuildWebCompiler (1.11.375).
I got 28 errors. All said Expected semicolon or closing curly-brace, found '-' (this might be related to #295). And there is a yellow warning sign on BuildBundlerMinifier (as well as BuildWebCompiler) if you pop open Dependencies -> NuGet under the web project.

Notes:
I downgraded the BuildBundlerMinifier to 2.5.357 and everything worked perfectly - it generates a minified version of the bundle files, as well as generates bundles on build.

Steps to recreate

  1. File -> New -> Project -> .NET Core to create a ASP.NET Core Web Application
  2. Install the latest nodejs
  3. Install Bootstrap beta 2 using npm: npm install bootstrap@4.0.0-beta.2
  4. Create a theme style file, i.e. dark.scss in a new folder 'assets/styles' and import bootstrap scss: @import "../../node_modules/bootstrap/scss/bootstrap";
  5. Install Bundler & Minifier and Web Compiler from tools -> extensions and updates
  6. Right click on dark.scss -> Web Compiler -> Compile, which should generate compilerconfig.json file
  7. Add bundleconfig.json and output the dark.css file to wwwroot
    [ { "outputFileName": "wwwroot/css/global.css", "inputFiles": [ "assets/styles/dark.css" ] } ]
  8. Right click on bundleconfig.json, select Bundler & Minifier and check Enable bundle on build.
@ChrisASearles
Copy link

Any reason this issue was closed? I'm getting the same problem building Bootstrap 4 beta 2 and downgrading to 2.5.357 didn't work.

@davidliang2008
Copy link
Author

aww I got everything working together - BuildBundlerMinifier (2.6.362) and BuildWebCompiler (1.11.375) with the latest Visual Studio Community 15.5.2 but I was so busy that I forgot what steps I took to get it working.

Maybe the VS updates fixed it? Have you tried to update to the latest?

@jgimness
Copy link

@ChrisASearles I have the same setup as you. Removing the top root and -- color vars allowed the minifier to complete. There's another issue open to fix this: #218

@rockstardev
Copy link
Collaborator

@davidliang2008 can you re-open this? It's obviously not fixed... anything we can do to help?

@davidliang2008 davidliang2008 reopened this Apr 4, 2018
@rockstardev
Copy link
Collaborator

OK, I'll likely take care of NUglify error: trullock/NUglify#17 (comment)

Once that's done can we then update this Minifier with new version @davidliang2008? Because it's likely lots of people will run into this problem now that Bootstrap4 uses CSS variables (--namedColor:#123456 breaks bundling)

@rockstardev
Copy link
Collaborator

rockstardev commented Apr 4, 2018

Pull request submitted to NUglify: trullock/NUglify#46

Once they merge can we update dependency and publish new version @madskristensen ?

@NicolasDorier
Copy link
Contributor

This just got merged!

@NicolasDorier
Copy link
Contributor

... and nuget pushed :)

@rockstardev
Copy link
Collaborator

@NicolasDorier french connection with @xoofx it seems ;)

@madskristensen can we now get new version of BundlerMinifier? So that everyone can use Bootstrap4?

@NicolasDorier
Copy link
Contributor

not even. Now just hoping @madskristensen still use github! Long time since the last activity in this repo. :(

@rockstardev
Copy link
Collaborator

rockstardev commented Apr 5, 2018

@NicolasDorier well he seems to be commiting last few days in other repos. If this issue talk doesn't get his attention I guess we can make use of your Twitter firepower.

rockstardev pushed a commit to rockstardev/BundlerMinifier that referenced this issue Apr 6, 2018
Resolves CSS Variables bug related to Bootstrap 4:
madskristensen#306
madskristensen pushed a commit that referenced this issue Apr 6, 2018
Resolves CSS Variables bug related to Bootstrap 4:
#306
@rockstardev
Copy link
Collaborator

2.6.375 out, fixes this problem: https://www.nuget.org/packages/BuildBundlerMinifier/

@affiahmedkhan
Copy link

2.8.xxx version fixed it for me

@adlesh
Copy link

adlesh commented Jan 13, 2020

This may be separate, but this felt like a good place to do put this. If you run into a similar error, for example mine was "Expected semicolon or closing curly-brace, found '@state-text-danger'". Simply remove the @ and wrap the left over in var(--state-text-danger). This allowed me to minify and bundle with no issue.

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

7 participants