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

Fix building on windows #4280

Merged
merged 1 commit into from
Feb 28, 2018
Merged

Fix building on windows #4280

merged 1 commit into from
Feb 28, 2018

Conversation

pieh
Copy link
Contributor

@pieh pieh commented Feb 28, 2018

This is fix for gatsby not building on windows after #3889 :

Error: Module not found: Error: Cannot resolve module 'E:LennartDocumentsGitHubgatsby-starter-portfolio-emma
  ode_modulesgatsby-plugin-react-helmetgatsby-ssr.js' in E:\Lennart\Documents\GitHub\gatsby-starter-portfolio-emma\.cache
  resolve module E:LennartDocumentsGitHubgatsby-starter-portfolio-emma
  ode_modulesgatsby-plugin-react-helmetgatsby-ssr.js in E:\Lennart\Documents\GitHub\gatsby-starter-portfolio-emma\.cache
    looking for modules in E:\Lennart\Documents\GitHub\gatsby-starter-portfolio-emma\node_modules
      E:\Lennart\Documents\GitHub\gatsby-starter-portfolio-emma\node_modules\E:LennartDocumentsGitHubgatsby-starter-portfolio-emma
  ode_modulesgatsby-plugin-react-helmetgatsby-ssr.js doesn't exist (module as directory)

Previous method ( this is change for context https://github.com/gatsbyjs/gatsby/pull/3889/files#diff-8c8b888e741f1c31e97d4bf05894f50dL178 ) would use path with / separators but path methods defaults to use \ separator on windows and as we write path to a file with unescaped \ this cause above problem.

Solution - use slash function/package on to convert backslashes to slashes - thanks @m-allanson for hint

@ghost ghost assigned pieh Feb 28, 2018
@ghost ghost added the review label Feb 28, 2018
@gatsbybot
Copy link
Collaborator

gatsbybot commented Feb 28, 2018

Deploy preview for gatsbygram ready!

Built with commit 1d9f5d9

https://deploy-preview-4280--gatsbygram.netlify.com

Coridyn referenced this pull request Feb 28, 2018
* Warn when replaceRenderer is implemented multiple times

* Remove unused import

* Add tests

* Back out 'named arguments' change from apiRunner

* Re-add required import

* Add first draft of docs page

* Simplify language based on results from Hemingway App

See http://www.hemingwayapp.com/

* Implement docs feedback

* Capitalisation

* Copy tweaks

* More concise 'add internal plugins'

* Use work from previous PR's to improve this

- remove duplicate error messages
- improve message format
- only run the last replaceRenderer plugin

* Remove unused import

* Use the reporter for nicer error formatting

* Exit on error during build

* Split code out into smaller functions and add tests

* Update comments
@KyleAMathews
Copy link
Contributor

Slash all the things! Slash and slash and slash and then maybe everything will work cross-os :-D

@KyleAMathews KyleAMathews merged commit bfb8f94 into gatsbyjs:master Feb 28, 2018
@ghost ghost removed the review label Feb 28, 2018
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

Successfully merging this pull request may close these issues.

3 participants