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

[BUG] Error in the build #62

Closed
alejandrojuarez675 opened this issue Nov 22, 2019 · 5 comments · Fixed by #76
Closed

[BUG] Error in the build #62

alejandrojuarez675 opened this issue Nov 22, 2019 · 5 comments · Fixed by #76
Labels

Comments

@alejandrojuarez675
Copy link

I download the source code and tried to do a deploy.

when i execute 'npm run-script build' the terminal said:

Creating an optimized production build...
Failed to compile.

Lexical error on line 1: Unrecognized text.
Erroneous area:
1: 100% - $sidebar-width
^.........^

@alejandrojuarez675 alejandrojuarez675 changed the title Error in the build [BUG] Error in the build Nov 22, 2019
@einazare
Copy link
Contributor

Hello there, @alejandrojuarez675 ,

Thank you for your interest in working with our products.
Why did you not follow our rules of opening an issue:

<!--
 IMPORTANT: Please use the following link to create a new issue:

  https://www.creative-tim.com/new-issue/light-bootstrap-dashboard-react

**If your issue was not created using the app above, it will be closed immediately.**
-->

<!--
Love Creative Tim? Do you need Angular, React, Vuejs or HTML? You can visit:
👉  https://www.creative-tim.com/bundles
👉  https://www.creative-tim.com
-->

I've just made a quick test and everything worked as expected, no error was thrown.

Best,
Manu

@DaveFerBear
Copy link

Was there ever a resolution to this? I'm having the same issue try to npm run build.

@einazare
Copy link
Contributor

Hello there, @DaveFerBear ,

I've just made a quick test and everything worked as expected, no error was thrown.
Please provide me with the following video:

  • Download the product
  • Unzip the product
  • Open terminal and cd into the project
  • Run node -v
  • Run npm -v
  • [Mac/Ubuntu/Linux] Run npm run install:clean
  • [Widnows] Run npm install
  • [Widnows] Run npm start
  • Showcase the issue

Best,
Manu

@jackbilestech
Copy link

Hey All,
@einazare i've managed to find a way for this to compile.

I was able to trackdown in _navbars.scss where the issue was arising. On compilation the output file would contain a $sidebar-width variable which the react-build componnet seems to not understand potentially explaining why the build and start command worked differently.

https://stackoverflow.com/questions/17982111/sass-variable-in-css-calc-function - A similar issue was mentioned here. Because we were performing a calc operation, interpolation is needed for this type of compiler.

Using the below injection builds and compiles fine. Tested with both npm run compile-sass, npm run build & npm run start.

_navbars.scss

&.fixed{
        //width: calc(100% - $sidebar-width); // No Interpolation
        width: calc(100% - #{$sidebar-width}); //Interpolate
        right: 0;
        left: auto;
        border-radius: 0;
    }

Hope this helps and i haven't broken something else....

@crisecheverria
Copy link

After the update with the Interpolation from @jackbilestech it worked:

Im using:

"react": "16.13.1",
"react-dom": "16.13.1",
"react-scripts": "3.4.1",
"@types/react": "16.9.41",
"typescript": "3.9.6"

einazare added a commit that referenced this issue Sep 24, 2020
einazare added a commit that referenced this issue Jan 21, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging a pull request may close this issue.

5 participants