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

Start and Build commands are failing on fresh install #29

Open
claytoncollie opened this issue Aug 3, 2020 · 2 comments
Open

Start and Build commands are failing on fresh install #29

claytoncollie opened this issue Aug 3, 2020 · 2 comments
Labels
bug Something isn't working

Comments

@claytoncollie
Copy link

claytoncollie commented Aug 3, 2020

I followed the instructions to include this in my plugin that I created using create-guten-block.

When I run either command from the readme, I am getting a fatal error.

.blockbook/index.js

import '../src/blocks/introduction/index.js'
import '../src/blocks/accordion/index.js'

import { registerBlockType } from 'blockbook-api';

// Register BlockBook blocks.
const blocks = [
	'contentpilot/accordion',
	'contentpilot/introduction',
];
blocks.forEach( ( block ) => registerBlockType( block ) );

From the log

0 info it worked if it ends with ok
1 verbose cli [
1 verbose cli   '/usr/local/Cellar/node/14.7.0/bin/node',
1 verbose cli   '/usr/local/bin/npm',
1 verbose cli   'run',
1 verbose cli   'blockbook:start'
1 verbose cli ]
2 info using npm@6.14.7
3 info using node@v14.7.0
4 verbose run-script [ 'preblockbook:start', 'blockbook:start', 'postblockbook:start' ]
5 info lifecycle content-pilot-blocks@1.5.0~preblockbook:start: content-pilot-blocks@1.5.0
6 info lifecycle content-pilot-blocks@1.5.0~blockbook:start: content-pilot-blocks@1.5.0
7 verbose lifecycle content-pilot-blocks@1.5.0~blockbook:start: unsafe-perm in lifecycle true
8 verbose lifecycle content-pilot-blocks@1.5.0~blockbook:start: PATH: /usr/local/lib/node_modules/npm/node_modules/npm-lifecycle/node-gyp-bin:/Users/claytoncollie/Documents/wordpress/contentpilot/app/public/wp-content/plugins/content-pilot-blocks/node_modules/.bin:/Users/claytoncollie/.rvm/gems/ruby-head/bin:/Users/claytoncollie/.rvm/gems/ruby-head@global/bin:/Users/claytoncollie/.rvm/rubies/ruby-head/bin:/usr/local/bin:/usr/bin:/bin:/usr/sbin:/sbin:/Users/claytoncollie/.rvm/gems/ruby-head/bin:/Users/claytoncollie/.rvm/gems/ruby-head@global/bin:/Users/claytoncollie/.rvm/rubies/ruby-head/bin:/Users/claytoncollie/.rvm/bin
9 verbose lifecycle content-pilot-blocks@1.5.0~blockbook:start: CWD: /Users/claytoncollie/Documents/wordpress/contentpilot/app/public/wp-content/plugins/content-pilot-blocks
10 silly lifecycle content-pilot-blocks@1.5.0~blockbook:start: Args: [ '-c', 'blockbook start' ]
11 silly lifecycle content-pilot-blocks@1.5.0~blockbook:start: Returned: code: 1  signal: null
12 info lifecycle content-pilot-blocks@1.5.0~blockbook:start: Failed to exec blockbook:start script
13 verbose stack Error: content-pilot-blocks@1.5.0 blockbook:start: `blockbook start`
13 verbose stack Exit status 1
13 verbose stack     at EventEmitter.<anonymous> (/usr/local/lib/node_modules/npm/node_modules/npm-lifecycle/index.js:332:16)
13 verbose stack     at EventEmitter.emit (events.js:314:20)
13 verbose stack     at ChildProcess.<anonymous> (/usr/local/lib/node_modules/npm/node_modules/npm-lifecycle/lib/spawn.js:55:14)
13 verbose stack     at ChildProcess.emit (events.js:314:20)
13 verbose stack     at maybeClose (internal/child_process.js:1051:16)
13 verbose stack     at Process.ChildProcess._handle.onexit (internal/child_process.js:287:5)
14 verbose pkgid content-pilot-blocks@1.5.0
15 verbose cwd /Users/claytoncollie/Documents/wordpress/contentpilot/app/public/wp-content/plugins/content-pilot-blocks
16 verbose Darwin 19.5.0
17 verbose argv "/usr/local/Cellar/node/14.7.0/bin/node" "/usr/local/bin/npm" "run" "blockbook:start"
18 verbose node v14.7.0
19 verbose npm  v6.14.7
20 error code ELIFECYCLE
21 error errno 1
22 error content-pilot-blocks@1.5.0 blockbook:start: `blockbook start`
22 error Exit status 1
23 error Failed at the content-pilot-blocks@1.5.0 blockbook:start script.
23 error This is probably not a problem with npm. There is likely additional logging output above.
24 verbose exit [ 1, true ]

console errors

> blockbook start

✖ 「wds」: Invalid configuration object. Webpack has been initialised using a configuration object that does not match the API schema.
 - configuration has an unknown property 'mode'. These properties are valid:
   object { amd?, bail?, cache?, context?, dependencies?, devServer?, devtool?, entry, externals?, loader?, module?, name?, node?, output?, parallelism?, performance?, plugins?, profile?, recordsInputPath?, recordsOutputPath?, recordsPath?, resolve?, resolveLoader?, stats?, target?, watch?, watchOptions? }
   For typos: please correct them.
   For loader options: webpack 2 no longer allows custom properties in configuration.
     Loaders should be updated to allow passing options via loader options in module.rules.
     Until loaders are updated one can use the LoaderOptionsPlugin to pass these options to the loader:
     plugins: [
       new webpack.LoaderOptionsPlugin({
         // test: /\.xxx$/, // may apply this only for some modules
         options: {
           mode: ...
         }
       })
     ]
child_process.js:655
    throw err;
    ^

Error: Command failed: NODE_ENV=development /Users/claytoncollie/Documents/wordpress/contentpilot/app/public/wp-content/plugins/content-pilot-blocks/node_modules/webpack-dev-server/bin/webpack-dev-server.js --open /Users/claytoncollie/Documents/wordpress/contentpilot/app/public/wp-content/plugins/content-pilot-blocks/node_modules/blockbook-cli/src/app/index.js --config /Users/claytoncollie/Documents/wordpress/contentpilot/app/public/wp-content/plugins/content-pilot-blocks/node_modules/blockbook-cli/src/cli/webpack.config.js
    at checkExecSyncError (child_process.js:616:11)
    at execSync (child_process.js:652:15)
    at Object.<anonymous> (/Users/claytoncollie/Documents/wordpress/contentpilot/app/public/wp-content/plugins/content-pilot-blocks/node_modules/blockbook-cli/src/cli/index.js:36:1)
    at Module._compile (internal/modules/cjs/loader.js:1256:30)
    at Object.Module._extensions..js (internal/modules/cjs/loader.js:1277:10)
    at Module.load (internal/modules/cjs/loader.js:1105:32)
    at Function.Module._load (internal/modules/cjs/loader.js:967:14)
    at Function.executeUserEntryPoint [as runMain] (internal/modules/run_main.js:60:12)
    at internal/main/run_main_module.js:17:47 {
  status: 1,
  signal: null,
  output: [ null, null, null ],
  pid: 88814,
  stdout: null,
  stderr: null
}
@youknowriad
Copy link
Owner

Quickly looking at the error, it seems that there might be a conflict between different webpack versions. Blockbook expects > 4 while it seems you also have a Webpack 3 version probably coming from cgb

@youknowriad youknowriad added the bug Something isn't working label Aug 3, 2020
@claytoncollie
Copy link
Author

On further investigation of CBG, it is running webpack 3 and there is an open PR from last year to upgrade to v4. Only other way would be to eject my scripts and update it on my own. I don't think I have the time or knowledge to pull that off. Will have to shelve integration with your package until this PR gets merged.

ahmadawais/create-guten-block#164

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants