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

npm run build throws error : Generating JavaScript bundles failed #69

Open
sibamohanty995 opened this issue Jun 25, 2018 · 3 comments
Open

Comments

@sibamohanty995
Copy link

Have tried all the workarounds. Nothing seems to be working.

If i update my node version to 9.10.1, my sharp compatibility goes for a toss as they haven't come up with a sharp package which is compatible with node version 9.10.1.

[email protected] build C:\Users\I339665\Documents\CC\gatsby-starter > gatsby build success delete html and css files from previous builds — 0.039 s success open and validate gatsby-config — 0.007 s info One or more of your plugins have changed since the last time you ran Gatsby. As a precaution, we're deleting your site's cache to ensure there's not any stale data success copy gatsby files — 0.073 s success onPreBootstrap — 1.949 s success source and transform nodes — 0.224 s success building schema — 0.357 s success createLayouts — 0.022 s success createPages — 0.058 s success createPagesStatefully — 0.040 s success onPreExtractQueries — 0.002 s success update schema — 0.162 s success extract queries from components — 0.487 s success run graphql queries — 0.560 s success write out page data — 0.015 s success write out redirect data — 0.004 s success onPostBootstrap — 0.003 s info bootstrap finished - 7.283 s ⠐ Building CSSts-loader: Using [email protected] and C:\Users\I339665\Documents\CC\gatsby-starter\tsconfig.json success Building CSS — 29.443 s ⢀ Building production JavaScript bundlests-loader: Using [email protected] and C:\Users\I339665\Documents\CC\gatsby-starter\tsconfig.json error Generating JavaScript bundles failed Error: C:\Users\I339665\Documents\CC\gatsby-starter\node_modules@types\lodash\index.d.ts (10186,53): error TS2344: Type 'T' does not satisfy the constraint 'object'. Error: .//gatsby-module-loader?name=component---src-templates-blog-post-tsx!./src/templates/blog-post.tsx (10,29): error TS7006: Parameter 'props' implicitly has an 'any' type. Error: .//gatsby-module-loader?name=component---src-templates-blog-post-tsx!./src/templates/blog-post.tsx (17,61): error TS7006: Parameter 'tag' implicitly has an 'any' type. Error: .//gatsby-module-loader?name=component---src-templates-blog-post-tsx!./src/templates/blog-post.tsx (20,56): error TS7006: Parameter '_ref' implicitly has an 'any' type. Error: .//babel-loader/lib?{"plugins":["C://Users//I339665//Documents//CC//gatsby-starter////gatsby//dist//utils//ba bel-plugin-extract-graphql.js","C://Users//I339665//Documents//CC//gatsby-starter////babel-plugin-add-module-exports/ /lib//index.js","C://Users//I339665//Documents//CC//gatsby-starter////babel-plugin-transform-object-assign//lib//inde x.js"],"presets":[["C://Users//I339665//Documents//CC//gatsby-starter////babel-preset-env//lib//index.js",{"loose":tr ue,"uglify":true,"modules":"commonjs","targets":{"browsers":["> 1%","last 2 versions","IE >= 9"]},"exclude":["transfor m-regenerator","transform-es2015-typeof-symbol"]}],"C://Users//I339665//Documents//CC//gatsby-starter////babel-preset -stage-0//lib//index.js","C://Users//I339665//Documents//CC//gatsby-starter////babel-preset-react//lib//index.js"],"c acheDirectory":true}!.//ts-loader?{"compilerOptions":{"target":"esnext","experimentalDecorators":true,"jsx":"react"," module":"commonjs"},"transpileOnly":true}!.//babel-loader/lib?{"presets":["babel-preset-env"],"plugins":["C://Users// I339665//Documents//CC//gatsby-starter////gatsby//dist//utils//babel-plugin-extract-graphql.js"]}!.//ts-loader!./src /templates/blog-post.tsx (10,29): error TS7006: Parameter 'props' implicitly has an 'any' type. Error: .//babel-loader/lib?{"plugins":["C://Users//I339665//Documents//CC//gatsby-starter////gatsby//dist//utils//ba bel-plugin-extract-graphql.js","C://Users//I339665//Documents//CC//gatsby-starter////babel-plugin-add-module-exports/ /lib//index.js","C://Users//I339665//Documents//CC//gatsby-starter////babel-plugin-transform-object-assign//lib//inde x.js"],"presets":[["C://Users//I339665//Documents//CC//gatsby-starter////babel-preset-env//lib//index.js",{"loose":tr ue,"uglify":true,"modules":"commonjs","targets":{"browsers":["> 1%","last 2 versions","IE >= 9"]},"exclude":["transfor m-regenerator","transform-es2015-typeof-symbol"]}],"C://Users//I339665//Documents//CC//gatsby-starter////babel-preset -stage-0//lib//index.js","C://Users//I339665//Documents//CC//gatsby-starter////babel-preset-react//lib//index.js"],"c acheDirectory":true}!.//ts-loader?{"compilerOptions":{"target":"esnext","experimentalDecorators":true,"jsx":"react"," module":"commonjs"},"transpileOnly":true}!.//babel-loader/lib?{"presets":["babel-preset-env"],"plugins":["C://Users// I339665//Documents//CC//gatsby-starter////gatsby//dist//utils//babel-plugin-extract-graphql.js"]}!.//ts-loader!./src /templates/blog-post.tsx (17,61): error TS7006: Parameter 'tag' implicitly has an 'any' type. Error: .//babel-loader/lib?{"plugins":["C://Users//I339665//Documents//CC//gatsby-starter////gatsby//dist//utils//ba bel-plugin-extract-graphql.js","C://Users//I339665//Documents//CC//gatsby-starter////babel-plugin-add-module-exports/ /lib//index.js","C://Users//I339665//Documents//CC//gatsby-starter////babel-plugin-transform-object-assign//lib//inde x.js"],"presets":[["C://Users//I339665//Documents//CC//gatsby-starter////babel-preset-env//lib//index.js",{"loose":tr ue,"uglify":true,"modules":"commonjs","targets":{"browsers":["> 1%","last 2 versions","IE >= 9"]},"exclude":["transfor m-regenerator","transform-es2015-typeof-symbol"]}],"C://Users//I339665//Documents//CC//gatsby-starter////babel-preset -stage-0//lib//index.js","C://Users//I339665//Documents//CC//gatsby-starter////babel-preset-react//lib//index.js"],"c acheDirectory":true}!.//ts-loader?{"compilerOptions":{"target":"esnext","experimentalDecorators":true,"jsx":"react"," module":"commonjs"},"transpileOnly":true}!.//babel-loader/lib?{"presets":["babel-preset-env"],"plugins":["C://Users// I339665//Documents//CC//gatsby-starter////gatsby//dist//utils//babel-plugin-extract-graphql.js"]}!.//ts-loader!./src /templates/blog-post.tsx (20,56): error TS7006: Parameter '_ref' implicitly has an 'any' type. Error: .//gatsby-module-loader?name=component---src-pages-index-tsx!./src/pages/index.tsx (9,29): error TS7006: Parameter 'props' implicitly has an 'any' type. Error: .//babel-loader/lib?{"plugins":["C://Users//I339665//Documents//CC//gatsby-starter////gatsby//dist//utils//ba bel-plugin-extract-graphql.js","C://Users//I339665//Documents//CC//gatsby-starter////babel-plugin-add-module-exports/ /lib//index.js","C://Users//I339665//Documents//CC//gatsby-starter////babel-plugin-transform-object-assign//lib//inde x.js"],"presets":[["C://Users//I339665//Documents//CC//gatsby-starter////babel-preset-env//lib//index.js",{"loose":tr ue,"uglify":true,"modules":"commonjs","targets":{"browsers":["> 1%","last 2 versions","IE >= 9"]},"exclude":["transfor m-regenerator","transform-es2015-typeof-symbol"]}],"C://Users//I339665//Documents//CC//gatsby-starter////babel-preset -stage-0//lib//index.js","C://Users//I339665//Documents//CC//gatsby-starter////babel-preset-react//lib//index.js"],"c acheDirectory":true}!.//ts-loader?{"compilerOptions":{"target":"esnext","experimentalDecorators":true,"jsx":"react"," module":"commonjs"},"transpileOnly":true}!.//babel-loader/lib?{"presets":["babel-preset-env"],"plugins":["C://Users// I339665//Documents//CC//gatsby-starter////gatsby//dist//utils//babel-plugin-extract-graphql.js"]}!.//ts-loader!./src /pages/index.tsx (9,29): error TS7006: Parameter 'props' implicitly has an 'any' type. Error: .//gatsby-module-loader?name=component---src-pages-blog-tsx!./src/pages/blog.tsx (11,29): error TS7006: Parameter 'props' implicitly has an 'any' type. Error: .//gatsby-module-loader?name=component---src-pages-blog-tsx!./src/pages/blog.tsx (18,92): error TS7006: Parameter '_ref' implicitly has an 'any' type. Error: .//babel-loader/lib?{"plugins":["C://Users//I339665//Documents//CC//gatsby-starter////gatsby//dist//utils//ba bel-plugin-extract-graphql.js","C://Users//I339665//Documents//CC//gatsby-starter////babel-plugin-add-module-exports/ /lib//index.js","C://Users//I339665//Documents//CC//gatsby-starter////babel-plugin-transform-object-assign//lib//inde x.js"],"presets":[["C://Users//I339665//Documents//CC//gatsby-starter////babel-preset-env//lib//index.js",{"loose":tr ue,"uglify":true,"modules":"commonjs","targets":{"browsers":["> 1%","last 2 versions","IE >= 9"]},"exclude":["transfor m-regenerator","transform-es2015-typeof-symbol"]}],"C://Users//I339665//Documents//CC//gatsby-starter////babel-preset -stage-0//lib//index.js","C://Users//I339665//Documents//CC//gatsby-starter////babel-preset-react//lib//index.js"],"c acheDirectory":true}!.//ts-loader?{"compilerOptions":{"target":"esnext","experimentalDecorators":true,"jsx":"react"," module":"commonjs"},"transpileOnly":true}!.//babel-loader/lib?{"presets":["babel-preset-env"],"plugins":["C://Users// I339665//Documents//CC//gatsby-starter////gatsby//dist//utils//babel-plugin-extract-graphql.js"]}!.//ts-loader!./src /pages/blog.tsx (11,29): error TS7006: Parameter 'props' implicitly has an 'any' type. Error: .//babel-loader/lib?{"plugins":["C://Users//I339665//Documents//CC//gatsby-starter////gatsby//dist//utils//ba bel-plugin-extract-graphql.js","C://Users//I339665//Documents//CC//gatsby-starter////babel-plugin-add-module-exports/ /lib//index.js","C://Users//I339665//Documents//CC//gatsby-starter////babel-plugin-transform-object-assign//lib//inde x.js"],"presets":[["C://Users//I339665//Documents//CC//gatsby-starter////babel-preset-env//lib//index.js",{"loose":tr ue,"uglify":true,"modules":"commonjs","targets":{"browsers":["> 1%","last 2 versions","IE >= 9"]},"exclude":["transfor m-regenerator","transform-es2015-typeof-symbol"]}],"C://Users//I339665//Documents//CC//gatsby-starter////babel-preset -stage-0//lib//index.js","C://Users//I339665//Documents//CC//gatsby-starter////babel-preset-react//lib//index.js"],"c acheDirectory":true}!.//ts-loader?{"compilerOptions":{"target":"esnext","experimentalDecorators":true,"jsx":"react"," module":"commonjs"},"transpileOnly":true}!.//babel-loader/lib?{"presets":["babel-preset-env"],"plugins":["C://Users// I339665//Documents//CC//gatsby-starter////gatsby//dist//utils//babel-plugin-extract-graphql.js"]}!.//ts-loader!./src /pages/blog.tsx (18,92): error TS7006: Parameter '_ref' implicitly has an 'any' type. Error: ./src/layouts/index.tsx (3,60): error TS7006: Parameter 'target' implicitly has an 'any' type. Error: ./src/layouts/index.tsx (3,68): error TS7006: Parameter 'props' implicitly has an 'any' type. Error: ./src/layouts/index.tsx (3,368): error TS7006: Parameter 'Constructor' implicitly has an 'any' type. Error: ./src/layouts/index.tsx (3,381): error TS7006: Parameter 'protoProps' implicitly has an 'any' type. Error: ./src/layouts/index.tsx (3,393): error TS7006: Parameter 'staticProps' implicitly has an 'any' type. Error: ./src/layouts/index.tsx (5,26): error TS7006: Parameter 'instance' implicitly has an 'any' type. Error: ./src/layouts/index.tsx (5,36): error TS7006: Parameter 'Constructor' implicitly has an 'any' type. Error: ./src/layouts/index.tsx (7,37): error TS7006: Parameter 'self' implicitly has an 'any' type. Error: ./src/layouts/index.tsx (7,43): error TS7006: Parameter 'call' implicitly has an 'any' type. Error: ./src/layouts/index.tsx (9,20): error TS7006: Parameter 'subClass' implicitly has an 'any' type. Error: ./src/layouts/index.tsx (9,30): error TS7006: Parameter 'superClass' implicitly has an 'any' type. Error: ./src/layouts/index.tsx (28,14): error TS7023: 'DefaultLayout' implicitly has return type 'any' because it does not have a return type annotation and is referenced directly or indirectly in one of its return expressions. Error: ./src/layouts/index.tsx (31,64): error TS2339: Property 'proto' does not exist on type '() => any'. m Error: ./src/layouts/index.tsx (34,5): error TS2554: Expected 3 arguments, but got 2. Error: ./src/components/TagsCard/TagsCard.tsx (6,29): error TS7006: Parameter 'props' implicitly has an 'any' type. Error: ./src/components/TagsCard/TagsCard.tsx (7,330): error TS7006: Parameter 'tag' implicitly has an 'any' type. Error: C:\Users\I339665\Documents\CC\gatsby-starter\src\components\TagsCard\TagsCard.test.tsx (4,22): error TS2306: File 'C:/Users/I339665/Documents/CC/gatsby-starter/src/compon ents/TagsCard/TagsCard.tsx' is not a module. Error: C:\Users\I339665\Documents\CC\gatsby-starter\src\components\TagsCard\TagsCard.stories.tsx (8,22): error TS2306: File 'C:/Users/I339665/Documents/CC/gatsby-starter/src/compon ents/TagsCard/TagsCard.tsx' is not a module. Error: ./src/components/SidebarMenu/SidebarMenu.tsx (7,33): error TS7006: Parameter '_ref' implicitly has an 'any' type. Error: ./src/components/SidebarMenu/SidebarMenu.tsx (13,38): error TS7006: Parameter 'item' implicitly has an 'any' type. Error: ./src/components/SidebarMenu/SidebarMenu.tsx (16,43): error TS7006: Parameter 'item' implicitly has an 'any' type. Error: ./src/components/SidebarMenu/SidebarMenu.tsx (19,240): error TS7006: Parameter 'item' implicitly has an 'any' type. Error: ./src/components/SidebarMenu/SidebarMenu.tsx (24,48): error TS7006: Parameter 'state' implicitly has an 'any' type. Error: C:\Users\I339665\Documents\CC\gatsby-starter\src\components\SidebarMenu\SidebarMenu.test.tsx (4,29): error TS2306: File 'C:/Users/I339665/Documents/CC/gatsby-starter/src/compon ents/SidebarMenu/SidebarMenu.tsx' is not a module. Error: C:\Users\I339665\Documents\CC\gatsby-starter\src\components\SidebarMenu\SidebarMenu.stories.tsx (9,29): error TS2306: File 'C:/Users/I339665/Documents/CC/gatsby-starter/src/compon ents/SidebarMenu/SidebarMenu.tsx' is not a module. Error: ./src/components/HeaderMenu/HeaderMenu.tsx (8,32): error TS7006: Parameter '_ref' implicitly has an 'any' type. Error: ./src/components/HeaderMenu/HeaderMenu.tsx (16,196): error TS7006: Parameter 'item' implicitly has an 'any' type. Error: C:\Users\I339665\Documents\CC\gatsby-starter\src\components\HeaderMenu\HeaderMenu.test.tsx (4,28): error TS2306: File 'C:/Users/I339665/Documents/CC/gatsby-starter/src/compon ents/HeaderMenu/HeaderMenu.tsx' is not a module. Error: C:\Users\I339665\Documents\CC\gatsby-starter\src\components\HeaderMenu\HeaderMenu.stories.tsx (9,28): error TS2306: File 'C:/Users/I339665/Documents/CC/gatsby-starter/src/compon ents/HeaderMenu/HeaderMenu.tsx' is not a module. Error: ./src/components/BlogPagination/BlogPagination.tsx (7,29): error TS7006: Parameter 'props' implicitly has an 'any' type. Error: ./src/components/BlogPagination/BlogPagination.tsx (12,123): error TS7006: Parameter 'index' implicitly has an 'any' type. Error: C:\Users\I339665\Documents\CC\gatsby-starter\src\components\BlogPagination\BlogPagination.test.tsx (4,28): error TS2306: File 'C:/Users/I339665/Documents/CC/gatsby-starter/src/compon ents/BlogPagination/BlogPagination.tsx' is not a module. Error: C:\Users\I339665\Documents\CC\gatsby-starter\src\components\BlogPagination\BlogPagination.stories.tsx (9,28): error TS2306: File 'C:/Users/I339665/Documents/CC/gatsby-starter/src/compon ents/BlogPagination/BlogPagination.tsx' is not a module. Error: ./src/store.ts (12,29): error TS7006: Parameter 'state' implicitly has an 'any' type. Error: ./src/store.ts (12,36): error TS7006: Parameter 'action' implicitly has an 'any' type. Error: ./src/css/semantic.min.css Module build failed: Error: Loader C:\Users\I339665\Documents\CC\gatsby-starter\node_modules\url\url.js?{"limit":10000 ,"name":"static/[name].[hash:8].[ext]"} didn't return a function at NormalModule.loadPitch (C:\Users\I339665\Documents\CC\gatsby-starter\node_modules\webpack\node_modules\webpack- core\lib\NormalModuleMixin.js:215:20) at NormalModule.doBuild (C:\Users\I339665\Documents\CC\gatsby-starter\node_modules\webpack\node_modules\webpack-co re\lib\NormalModuleMixin.js:241:4) at NormalModule.build (C:\Users\I339665\Documents\CC\gatsby-starter\node_modules\webpack\lib\NormalModule.js:84:14 ) at Compilation.buildModule (C:\Users\I339665\Documents\CC\gatsby-starter\node_modules\webpack\lib\Compilation.js:1 26:9) at C:\Users\I339665\Documents\CC\gatsby-starter\node_modules\webpack\lib\Compilation.js:309:10 at C:\Users\I339665\Documents\CC\gatsby-starter\node_modules\webpack\lib\NormalModuleFactory.js:58:13 at NormalModuleFactory.applyPluginsAsyncWaterfall (C:\Users\I339665\Documents\CC\gatsby-starter\node_modules\tapab le\lib\Tapable.js:75:69) at onDoneResolving (C:\Users\I339665\Documents\CC\gatsby-starter\node_modules\webpack\lib\NormalModuleFactory.js:3 8:11) at onDoneResolving (C:\Users\I339665\Documents\CC\gatsby-starter\node_modules\webpack\lib\NormalModuleFactory.js:1 21:6) at C:\Users\I339665\Documents\CC\gatsby-starter\node_modules\webpack\lib\NormalModuleFactory.js:116:7 at C:\Users\I339665\Documents\CC\gatsby-starter\node_modules\async\lib\async.js:726:13 at C:\Users\I339665\Documents\CC\gatsby-starter\node_modules\async\lib\async.js:52:16 at done (C:\Users\I339665\Documents\CC\gatsby-starter\node_modules\async\lib\async.js:246:17) at C:\Users\I339665\Documents\CC\gatsby-starter\node_modules\async\lib\async.js:44:16 at C:\Users\I339665\Documents\CC\gatsby-starter\node_modules\async\lib\async.js:723:17 at C:\Users\I339665\Documents\CC\gatsby-starter\node_modules\async\lib\async.js:167:37 @ ./src/layouts/index.tsx 39:0-34 npm ERR! code ELIFECYCLE npm ERR! errno 1 npm ERR! [email protected] build: gatsby build 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! C:\Users\I339665\AppData\Roaming\npm-cache_logs\2018-06-25T11_05_31_043Z-debug.log

@fabien0102
Copy link
Owner

Gatsby 2.0 beta is live, I need to update all this starter. For now we have some weird compilation fails and I don't really know why… sometime is working sometime not, and it's really hard to debug (because of course, on my computer, it's working).

Really sorry for this bunch of errors, I really need to re-work a bit on this project, but I also have a lot to do aside… Time is always the issue ^^

Regarding you logs, it's somewhere in Typescript, you can begin by allow implicit any 😉

@mcku
Copy link

mcku commented Sep 23, 2018

@fabien0102 Personally I like semantic-ui & react & typescript and using Gatsby 2, i have gone through the upgrade procedure here, at a heavily personalized fork. I did not have time to remove the personalization from the blog, sorry. But even that should help you quickly update the starter.

However,with Gatsby 2 there are some issues with image processing. I am not so familiar with Gatsby therefore could not figure out what causes the issues with graphql image processing. ImageSharp responsiveResolution appears not to be available anymore, correct? Any suggestions in that regard?

Thanks in advance!

@mcku
Copy link

mcku commented Sep 24, 2018

I have later discovered that there was a "next" branch for the upgrade. 👍 build is fine with that branch. There was only one thing i had to fix:

in blogs.tsx
const avatar: ImageSharp = frontmatter.author.avatar.children && frontmatter.author.avatar.children[0] as ImageSharp || frontmatter.author.avatar.childImageSharp as ImageSharp;

instead of
const avatar = frontmatter.author.avatar.children[0] as ImageSharp;

because sometimes avatars are childImageSharp

Now it builds fine and works very well with gatsby 2.

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

No branches or pull requests

3 participants