Gatsby: [1.0] Generating HTML Hangs on Windows

Created on 11 Jun 2017  ยท  14Comments  ยท  Source: gatsbyjs/gatsby

This is an issue on the HEAD. It can be seen on this (random, but) recent appveyor run. It appears to hang at this line in build-html.js. With console.log(compilerConfig.resolve()) on the line prior, we get the following output. That is as far as I have gotten, but just wanted to have a place that we can track the bug if others are also looking at trying to resolve the error.

{ context: 'C:/folder/gatsby/examples/gatsbygram',
  node: { __filename: true },
  entry: { main: 'C:/folder/gatsby/examples/gatsbygram/.cache/static-entry' },
  debug: true,
  target: 'node',
  profile: false,
  devtool: false,
  output:
   { path: 'folder/gatsby/examples/gatsbygram/public',
     filename: 'render-page.js',
     libraryTarget: 'umd',
     publicPath: '/' },
  resolveLoader:
   { root: [ 'C:\\folder\\gatsby\\examples\\gatsbygram\\node_modules' ],
     modulesDirectories:
      [ 'C:\\folder\\gatsby\\examples\\gatsbygram\\node_modules\\gatsby\\dist\\loaders',
        'node_modules' ] },
  plugins:
   [ StaticSiteGeneratorWebpackPlugin {
       entry: 'render-page.js',
       paths: [Array],
       locals: undefined,
       globals: undefined,
       crawl: false },
     DefinePlugin { definitions: [Object] },
     ExtractTextPlugin { filename: 'build-html-styles.css', options: {}, id: 3 },
     ProvidePlugin { definitions: [Object] } ],
  resolve:
   { extensions: [ '', '.js', '.jsx' ],
     modulesDirectories:
      [ 'C:/folder/gatsby/examples/gatsbygram/node_modules',
        'node_modules',
        'node_modules/gatsby/node_modules' ] },
  module:
   { loaders:
      [ [Object],
        [Object],
        [Object],
        [Object],
        [Object],
        [Object],
        [Object] ] } }
help wanted bug

Most helpful comment

Oh my oh my oh my... we have a successful build!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! https://ci.appveyor.com/project/KyleAMathews/gatsby/build/1.0.558/job/fl0r9nvova7y88q9

screen shot 2017-06-13 at 4 26 26 pm

Word of advice kiddos, never ever mess with windows paths.

Cleaning up my PR a bit, one other small fix, then I'm going to release a beta ๐ŸŽ‰

All 14 comments

I took a crack at it tonight in #1158. Cherry picking a commit from you @fabien0102 fixed most of the problems but it seems that queries aren't being run right now which it seems is the last problem.

https://ci.appveyor.com/project/KyleAMathews/gatsby/build/1.0.525/job/1w57eeo1jvmyslbu

@fabien0102 if you have a bit of time to take a crack at this, would really appreciate it. I'm releasing the first beta tomorrow so would love to have this fixed for that.

@johann-sonntagbauer if you're around and have a bit of spare time, would appreciate you looking around a bit to see if you can get gatsbygram to build correctly.

@KyleAMathews @jbolda will take a look at that problem today.

I was able to get it to build, but we need to go through the plugins as well. If you literally go through the config ( https://github.com/gatsbyjs/gatsby/blob/1.0/packages/gatsby/src/utils/webpack.config.js ) and search for directory, everything needs to be path.normalize or path.join. If you see the snippet above, any of the / are wrong and the \ is correct (on Windows obviously). Last night I was able to get it to build doing that and setting the plugin line ( https://github.com/gatsbyjs/gatsby/blob/1.0/packages/gatsby/src/utils/webpack.config.js#L497 ) to "". I'm presuming we just need to do similar through the plugins.

I'm narrowing in on the problem. I think the remaining problems are in the file inference. Gatsbygram uses this extensively as the posts.json file has references to all the image files. If that link isn't created then the queries fail which seems to be what's happening.

in the cache directory in pages.json the path gets mixed up.

current

{
        "componentChunkName": "page-component---src-pages-index-js",
        "jsonName": "c-projects-gatsby-examples-gatsbygram-src-pages.json",
        "path": "/C:\\projects\\gatsby\\examples\\gatsbygram\\src\\pages/"
}

think it should be

{
        "componentChunkName": "page-component---src-pages-index-js",
        "jsonName": "c-projects-gatsby-examples-gatsbygram-src-pages.json",
        "path": "/"
}

No that's the "url" pathname. Not path to a file

On Tue, Jun 13, 2017, 1:26 PM Johann Hubert Sonntagbauer <
[email protected]> wrote:

in the cache directory in pages.json the path gets mixed up.

current

{
"componentChunkName": "page-component---src-pages-index-js",
"jsonName": "c-projects-gatsby-examples-gatsbygram-src-pages.json",
"path": "/C:\projects\gatsby\examples\gatsbygram\src\pages/"
}

think it should be

{
"componentChunkName": "page-component---src-pages-index-js",
"jsonName": "c-projects-gatsby-examples-gatsbygram-src-pages.json",
"path": "/"
}

โ€”
You are receiving this because you were mentioned.

Reply to this email directly, view it on GitHub
https://github.com/gatsbyjs/gatsby/issues/1146#issuecomment-308237957,
or mute the thread
https://github.com/notifications/unsubscribe-auth/AAEVhxxsRldIT8kx8nTleODtw0_KngcJks5sDvBigaJpZM4N2eM0
.

exactly :)

oh haha. Yeah I fixed that already. Try testing against my PR #1158

This is the latest build on Appveyor https://ci.appveyor.com/project/KyleAMathews/gatsby/build/1.0.547/job/56a8owbj0dkq99fh

Current problem looking at is it's not extracting queries for the template pages. The query for src/pages/index.js is run but all the post template queries aren't being extracted so also not being run.

@KyleAMathews I'm sorry, I don't have many time this week to have a look. But your last issue looks my issue with my starter ;) (so it's a windows trouble and not typescript!)

Oh my oh my oh my... we have a successful build!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! https://ci.appveyor.com/project/KyleAMathews/gatsby/build/1.0.558/job/fl0r9nvova7y88q9

screen shot 2017-06-13 at 4 26 26 pm

Word of advice kiddos, never ever mess with windows paths.

Cleaning up my PR a bit, one other small fix, then I'm going to release a beta ๐ŸŽ‰

Fixed in #1158

tested the latest 1.0 release and paths look fine now. checked cache redux-state.json pages.json and the json files contain the resolved queries. ๐Ÿ‘

Awesome! Thanks so much for testing! Really relieved we got this squared
away and tests are passing finally. Thanks to everyone who helped out!

On Tue, Jun 13, 2017, 10:22 PM Johann Hubert Sonntagbauer <
[email protected]> wrote:

tested the latest 1.0 release and paths look fine now. checked cache
redux-state.json pages.json and the json files contain the resolved
queries. ๐Ÿ‘

โ€”
You are receiving this because you modified the open/close state.

Reply to this email directly, view it on GitHub
https://github.com/gatsbyjs/gatsby/issues/1146#issuecomment-308322632,
or mute the thread
https://github.com/notifications/unsubscribe-auth/AAEVh7kQgymIsiZBfxYjixIrOEejO_Bhks5sD239gaJpZM4N2eM0
.

Was this page helpful?
0 / 5 - 0 ratings

Related issues

timbrandin picture timbrandin  ยท  3Comments

kalinchernev picture kalinchernev  ยท  3Comments

theduke picture theduke  ยท  3Comments

mikestopcontinues picture mikestopcontinues  ยท  3Comments

totsteps picture totsteps  ยท  3Comments