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

[v2] Error during building static HTML for pages #5452

Closed
kripod opened this issue May 16, 2018 · 4 comments
Closed

[v2] Error during building static HTML for pages #5452

kripod opened this issue May 16, 2018 · 4 comments
Labels
help wanted Issue with a clear description that the community can help with. stale? Issue that may be closed soon due to the original author not responding any more. type: bug An issue or pull request relating to a bug in Gatsby

Comments

@kripod
Copy link
Contributor

kripod commented May 16, 2018

Description

Using the latest version of gatsby@2, I get the following error during gatsby build:

$ gatsby build
success delete html files from previous builds — 0.051 s
success open and validate gatsby-config.js — 0.008 s
success copy gatsby files — 0.113 s
success onPreBootstrap — 1.514 s
success source and transform nodes — 0.129 s
success building schema — 0.285 s
success createPages — 0.047 s
success createPagesStatefully — 0.053 s
success onPreExtractQueries — 0.001 s
success update schema — 0.112 s
success extract queries from components — 0.089 s
success run graphql queries — 0.057 s
success write out page data — 0.008 s
success write out redirect data — 0.002 s
success onPostBootstrap — 0.001 s

info bootstrap finished - 10.422 s

⢀ Building production JavaScript and CSS bundlesDEPRECATION WARNING on line 6, column 50 of stdin:
The value "#29b6f6aa" is currently parsed as a string, but it will be parsed as a color in
 co⠠ Building production JavaScript and CSS bundlesntinue parsing it as a string.

DEPRECATION WARNING on line 6, column 61 of stdin:
The value "#ffd60088" is currently parsed as a string, but it will be parsed as a color in
future versions of Sass. Use "unquote('#ffd60088')" to continue parsing it as a string.

success Building production JavaScript and CSS bundles — 8.862 s
⢀ Building static HTML for pagesDEPRECATION WARNING on line 6, column 50 of stdin:
The value "#29b6f6aa" is currently parsed as a string, but it will be parsed as a color in
future versions of Sass. Use "unquote('#29b6f6aa')" to continue parsing it as a string.

DEPRECATION WARNING on line 6, column 61 of stdin:
s a ⠠ Building static HTML for pagesstring, but it will be parsed as a color in
future versions of Sass. Use "unquote('#ffd60088')" to continue parsing it as a string.


error Building static HTML for pages failed

See our docs page on debugging HTML builds for help https://goo.gl/yL9lND

  35 |  * }
  36 |  */
> 37 | exports.replaceRenderer = true
     |         ^
  38 |
  39 | /**
  40 |  * Allow a plugin to replace the static router component.


  WebpackError:

  - api-ssr-docs.js:37 NativeCompileCache._moduleCompile
    lib/.cache/api-ssr-docs.js:37:9

  - api-runner-ssr.js:36 Module._compile
    lib/.cache/api-runner-ssr.js:36:28

  - loader.js:53 Object.Module._extensions..js
    lib/.cache/loader.js:53:9

  - json-store.js:74 Module.load
    lib/.cache/json-store.js:74:12




  - api-runner-ssr.js:25 require
    lib/.cache/api-runner-ssr.js:25:3

  - universalModuleDefinition:7 Object.<anonymous>
    lib/webpack/universalModuleDefinition:7:1

  - api-runner-ssr.js:42 Module._compile
    lib/.cache/api-runner-ssr.js:42:4

  - bootstrap:7 Object.module.exports
    lib/webpack/bootstrap:7:1


error Command failed with exit code 1.
info Visit https://yarnpkg.com/en/docs/cli/run for documentation about this command.

Steps to reproduce

  1. Clone https:/simonyiszk/mvk-web/tree/aef3ff372b368afb0d2464d749733ba2db9e016a
  2. Install dependencies using Yarn
  3. Run yarn build

Environment

  • Gatsby version (npm list gatsby): 2.0.0-alpha.38
  • gatsby-cli version (gatsby --version): 2.0.0-alpha.38
  • Node.js version: 8.11.1
  • Operating System: Windows 10 x64

File contents (if changed)

See https:/simonyiszk/mvk-web/tree/aef3ff372b368afb0d2464d749733ba2db9e016a.

@m-allanson m-allanson added type: bug An issue or pull request relating to a bug in Gatsby help wanted Issue with a clear description that the community can help with. labels May 17, 2018
@m-allanson
Copy link
Contributor

Thanks for including the repo link. It looks like Gatsby is eating your original error message which is something like:

./src/pages/index.module.scss
Module build failed: /dev/mvk-web/src/data/assets/conference.jpg:1
(function (exports, require, module, __filename, __dirname) { ����
                                                              ^

SyntaxError: Invalid or unexpected token
    at new Script (vm.js:74:7)
    at NativeCompileCache._moduleCompile (/dev/mvk-web/node_modules/v8-compile-cache/v8-compile-cache.js:226:18)
    at Module._compile (/dev/mvk-web/node_modules/v8-compile-cache/v8-compile-cache.js:172:36)
    at Object.Module._extensions..js (internal/modules/cjs/loader.js:689:10)
    at Module.load (internal/modules/cjs/loader.js:589:32)
    at tryModuleLoad (internal/modules/cjs/loader.js:528:12)
    at Function.Module._load (internal/modules/cjs/loader.js:520:3)
    at Module.require (internal/modules/cjs/loader.js:626:17)
    at require (/dev/mvk-web/node_modules/v8-compile-cache/v8-compile-cache.js:159:20)
    at Object.<anonymous> (/dev/mvk-web/src/pages/index.module.scss:7:231)
    at Module._compile (/dev/mvk-web/node_modules/v8-compile-cache/v8-compile-cache.js:178:30)
    at Object.module.exports (/dev/mvk-web/node_modules/gatsby/dist/utils/webpack-extract-css-modules-map.js:16:5)
 @ ./src/pages/index.jsx 6:0-41 9:13-19 13:13-19
 @ ./.cache/sync-requires.js
 @ ./.cache/static-entry.js

Your actual error could be related to issue #3665, as removing the url() in ./src/pages/index.module.scss allows the site to build.

For this issue it looks like the reporter is trying to use sourcemaps to create a more useful error message. But in this case it seems like the error is already pointing to the source files, so the processed error ends up being incorrect.

The original error is handled here, and then run through prepareStackTrace which is where the original info is lost.

@wizsebastian
Copy link

Hello, I had this same error, the solution after the hours of problem search, I found the pages that did not make a default export and obtained the same name, resulting in a form with the same name and so solves it. If I did not know how to express can write to me [email protected]

@gatsbot gatsbot bot added the stale? Issue that may be closed soon due to the original author not responding any more. label Dec 17, 2018
@gatsbot
Copy link

gatsbot bot commented Dec 17, 2018

Old issues will be closed after 30 days of inactivity. This issue has been quiet for 20 days and is being marked as stale. Reply here or add the label "not stale" to keep this issue open!

@gatsbot
Copy link

gatsbot bot commented Dec 28, 2018

This issue is being closed due to inactivity. Is this a mistake? Please re-open this issue or create a new issue.

@gatsbot gatsbot bot closed this as completed Dec 28, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
help wanted Issue with a clear description that the community can help with. stale? Issue that may be closed soon due to the original author not responding any more. type: bug An issue or pull request relating to a bug in Gatsby
Projects
None yet
Development

No branches or pull requests

3 participants