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

failed Building production JavaScript and CSS bundles #23246

Closed
xBLADEx opened this issue Apr 18, 2020 · 7 comments
Closed

failed Building production JavaScript and CSS bundles #23246

xBLADEx opened this issue Apr 18, 2020 · 7 comments
Labels
status: needs reproduction This issue needs a simplified reproduction of the bug for further troubleshooting. type: question or discussion Issue discussing or asking a question about Gatsby

Comments

@xBLADEx
Copy link

xBLADEx commented Apr 18, 2020

I didn't know where else to turn to, searched everything I could but I'm stuck.
During gatsby build or npm run build I get this Unknown word error.
I'm using SCSS files and I can't help but wonder if that is the culprit since it points to a problem with styles.css.
I've removed node modules, removed cache, restarted everything.
Develop works perfectly, but build breaks and cannot complete.

plugins has gatsby-plugin-sass, no options being used.
I have node-sass. Where should I look?

D:\MAMP\htdocs\project (master -> origin)                                   
λ npx gatsby build                                                                 
success open and validate gatsby-configs - 0.021s                                  
success load plugins - 0.657s                                                      
success onPreInit - 0.002s                                                         
success delete html and css files from previous builds - 0.012s                    
success initialize cache - 0.005s                                                  
success copy gatsby files - 0.047s                                                 
success onPreBootstrap - 0.007s                                                    
success createSchemaCustomization - 0.004s                                         
success source and transform nodes - 0.276s                                        
success building schema - 0.201s                                                   
success createPages - 1.740s                                                       
success createPagesStatefully - 0.038s                                             
success onPreExtractQueries - 0.001s                                               
success update schema - 0.018s                                                     
success extract queries from components - 0.259s                                   
success write out requires - 0.004s                                                
success write out redirect data - 0.001s                                           
success onPostBootstrap - 0.001s                                                   
⠀                                                                                  
info bootstrap finished - 5.059 s                                                  
⠀                                                                                  
failed Building production JavaScript and CSS bundles - 4.994s                     
                                                                                   
 ERROR #98123  WEBPACK                                                             
                                                                                   
Generating JavaScript bundles failed                                               
                                                                                   
D:\MAMP\htdocs\project \styles.48f74db053b2eb5ceb4c.css:382:5: Unknown word  
                                                                                   
not finished run queries - 5.947s 
@xBLADEx xBLADEx added the type: question or discussion Issue discussing or asking a question about Gatsby label Apr 18, 2020
@xBLADEx
Copy link
Author

xBLADEx commented Apr 18, 2020

Commenting out my single scss import allowed me to build. This line is in my Layout.js:

import '../assets/scss/index.scss';

@TylerBarnes
Copy link
Contributor

Hi @xBLADEx !

Sorry to hear you're running into an issue. To help us best begin debugging the underlying cause, it is incredibly helpful if you're able to create a minimal reproduction. This is a simplified example of the issue that makes it clear and obvious what the issue is and how we can begin to debug it.

If you're up for it, we'd very much appreciate if you could provide a minimal reproduction and we'll be able to take another look.

Thanks for using Gatsby! 💜

@TylerBarnes TylerBarnes added the status: needs reproduction This issue needs a simplified reproduction of the bug for further troubleshooting. label Apr 18, 2020
@xBLADEx
Copy link
Author

xBLADEx commented Apr 18, 2020

Ok cool, I will work on setting up a reproduction, I might even be able to narrow in myself, thanks for the response.

@xBLADEx
Copy link
Author

xBLADEx commented Apr 18, 2020

So the problem was caused by setting a background image with a .svg in the .scss file. Still figuring out why but closing this as it's not a gatsby build issue.

@xBLADEx xBLADEx closed this as completed Apr 18, 2020
@crazydev901
Copy link

crazydev901 commented Feb 18, 2021

@xBLADEx how did you solve the issue? I'm getting a similar error when I tried gatsby build

@mosesoak
Copy link

@xBLADEx just ran into the exact same problem

@mfanuzzi
Copy link

mfanuzzi commented Jun 2, 2021

for those who may run into this in the future; in our case it was due to a bug within cssnano, that has just recently been patched:

#31589

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
status: needs reproduction This issue needs a simplified reproduction of the bug for further troubleshooting. type: question or discussion Issue discussing or asking a question about Gatsby
Projects
None yet
Development

No branches or pull requests

5 participants