mariusbalcytis / webpack-bundle

Bundle to Integrate Webpack into Symfony
MIT License
122 stars 36 forks source link

Invalid type for path "maba_webpack.bin.dev_server.executable.0". Expected scalar, but got array. #12

Closed Danita closed 8 years ago

Danita commented 8 years ago

Hi, thanks for this bundle! :smile:, I'm really looking forward to trying it in my app but I'm getting this error when I try to run the devserver with a custom configuration (I need it to run on port 8081):

[Symfony\Component\Config\Definition\Exception\InvalidTypeException]
  Invalid type for path "maba_webpack.bin.dev_server.executable.0". Expected scalar, but got array.

My config is:

maba_webpack:
    config:
        path: '%kernel.root_dir%/config/webpack.config.js'
        parameters:
            public_path: 'http://192.168.57.123:8081/compiled/'
    bin:
        dev_server:
            executable:
                - node
                - node_modules/webpack-dev-server/bin/webpack-dev-server.js
            arguments:
                - --port 8081

I can seem to find out what I'm doing wrong here. Any ideas?

mariusbalcytis commented 8 years ago

It was fixed with #9. Also see #3 and #4 as this will be the case for you, too:

  1. ---port and 8081 in separate lines
  2. You also need --host 0.0.0.0 as dev-server will not receive connection from other hosts if this will not be provided (only by localhost)

Just to note - you do not need to provide executable at all if defaults are ok for you. You could overwrite just the arguments part if needed.