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

Disable dev-server reload for PHP files? #1268

Open
stephanvierkant opened this issue May 1, 2024 · 3 comments
Open

Disable dev-server reload for PHP files? #1268

stephanvierkant opened this issue May 1, 2024 · 3 comments

Comments

@stephanvierkant
Copy link

Every time I change a PHP file in my project, dev-server reloads the page. That is really annoying, because when I create a syntax error, dev-server (/usr/bin/yarn encore dev-server) crashes:

[webpack-dev-server] 404s will fallback to '/index.html'
3% setup watch run RouteDump_Watchnode:internal/errors:984
const err = new Error(message);
^

// ...

stdout: 'ParseError {#5965\n' +
' #message: "syntax error, unexpected identifier "instancof""\n' +
' #code: 0\n' +

// ..
stderr: '2024-05-01T18:46:09+00:00 [critical] Uncaught Error: syntax error, unexpected identifier "instancof"\n'
}

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

Process finished with exit code 1

This is my config:

.configureDevServerOptions(options => {
    options.server = {
      type: 'https',
      options: {
        pfx: path.join(process.env.HOME, '.symfony/certs/default.p12')
      }
    }
    options.allowedHosts = 'all'
    options.port = 8080
    options.client = {
      overlay: false
    }
  })

I tried options.watchFiles, hot=false, etc. Nothing works. How can I disable this behaviour? It shouldn't reload when changing PHP files.

@carsonbot
Copy link

Thank you for this issue.
There has not been a lot of activity here for a while. Has this been resolved?

@stephanvierkant
Copy link
Author

No, not yet.

@Kocal
Copy link
Member

Kocal commented Nov 3, 2024

Hi @stephanvierkant, that's really weird, by default we do not watch PHP files for reload.
Can you provide us the whole webpack.config.js file and your project structure?

Thanks

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