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

Unable to build when using the editions package. #2919

Closed
nrdobie opened this issue Nov 15, 2017 · 1 comment · May be fixed by tejzpr/gatsby#61
Closed

Unable to build when using the editions package. #2919

nrdobie opened this issue Nov 15, 2017 · 1 comment · May be fixed by tejzpr/gatsby#61

Comments

@nrdobie
Copy link

nrdobie commented Nov 15, 2017

I am using Gatsby to build a documentation site for an internal component library. To make things easier I added the react-element-to-jsx-string so that our examples could automatically be rendered and displayed as JSX. However I am getting this error when running build.

npm run build

> [email protected] build /Users/***/docs
> gatsby build --prefix-paths

success delete html files from previous builds — 0.018 s
success open and validate gatsby-config.js — 0.004 s
success copy gatsby files — 0.040 s
success onPreBootstrap — 0.008 s
success source and transform nodes — 0.025 s
success building schema — 0.138 s
success createLayouts — 0.039 s
success createPages — 0.003 s
success createPagesStatefully — 0.052 s
success onPreExtractQueries — 0.001 s
success update schema — 0.088 s
success extract queries from components — 0.025 s
success run graphql queries — 0.005 s
success write out page data — 0.004 s
success write out redirect data — 0.005 s
success onPostBootstrap — 0.001 s

info bootstrap finished - 1.859 s

success Building CSS — 5.261 s
success Building production JavaScript bundles — 9.477 s

error Building static HTML for pages failed

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

  14 | };
  15 | function webpackContextResolve(req) {
> 16 |  return map[req] || (function() { throw new Error("Cannot find module '" + req + "'.") }());
     |                                  ^
  17 | };
  18 | webpackContext.keys = function webpackContextKeys() {
  19 |  return Object.keys(map);


  WebpackError: Cannot find module '/package.json'.
  
  - .*$:16 
    ~/sortobject ^/.//.*$:16:34
  
  - .*$:16 webpackContextResolve
    ~/sortobject ^/.//.*$:16:89
  
  - .*$:13 webpackContext
    ~/sortobject ^/.//.*$:13:1
  
  - index.js:200 Object.requirePackage
    ~/editions/es2015/index.js:200:1
  
  - index.js:3 Object.<anonymous>
    ~/sortobject/index.js:3:1
  
  
  - formatComplexDataStructure.js:17 Object.module.exports
    ~/react-element-to-jsx-string/dist/formatter/formatComplexDataStructure.js:17:1
  
  - formatPropValue.js:15 Object.<anonymous>
    ~/react-element-to-jsx-string/dist/formatter/formatPropValue.js:15:1
  

npm ERR! code ELIFECYCLE
npm ERR! errno 1
npm ERR! [email protected] build: `gatsby build --prefix-paths`
npm ERR! Exit status 1
npm ERR! 
npm ERR! Failed at the [email protected] build script.
npm ERR! This is probably not a problem with npm. There is likely additional logging output above.

npm ERR! A complete log of this run can be found in:
npm ERR!     /Users/***/.npm/_logs/2017-11-15T00_59_42_163Z-debug.log

After digging through the code I have found that the issue seems to be with the editions package not being compatible with the HTML build tools but I wasn't able to figure out why.


OS: macOS Sierra 10.12.6
Node: 8.1.4
NPM: 5.5.1
gatsby: 1.9.102
react-element-to-jsx-string: 13.0.0

@Chuloo
Copy link
Contributor

Chuloo commented Aug 29, 2018

There hasn't been any activity on this issue recently. Due to the high number of incoming GitHub notifications, we have to clean some of the old issues as many of them have already been resolved with the latest updates or explained in a previous issue.

Feel free to open a new one if you still experience this problem or a similar one! 👍

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 a pull request may close this issue.

2 participants