找不到 webpack encore 开发服务器/ [英] webpack encore dev-server not found /

查看:49
本文介绍了找不到 webpack encore 开发服务器/的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

Hello
我正在尝试通过键入 npm run dev-server 使用 webpack encore 运行开发服务器,当检查 localhost:9000 是让我 Cannot GET/ 并提供该日志

「wds」:项目运行在 http://localhost:9000/wds":webpack 输出来自 http://localhost:9000/build/wds":不是来自 webpack 的内容从 D:\xampp\htdocs\api-platform\public 提供wds":404s 将回退到/index.html


知道我已经更改了 package.json

脚本":{"dev-server": "encore dev-server --port 9000 --disable-host-check","dev": "encore dev","watch": "encore dev --watch","build": "encore production --progress"},

并查看文档https://symfony.com/doc/current/frontend/encore/dev-server.html

项目结构api 平台/node_modulesapi-platform/public/build/entrypoints.jsonapi-platform/public/build/manifest.jsonapi 平台/package.jsonapi-platform/webpack.config.json

控制器

/*** @Route("/", name="app")*/公共函数索引(){return $this->render('app/index.html.twig', []);}

解决方案

最后通过订阅几个步骤来解决这个问题.

  1. 转到 package.json 并添加端口,disable-host-check 到您的开发服务器:<块引用>

    "dev-server": "encore dev-server --port 9000 --disable-host-check",

  2. 转到您的应用程序的主机(不是开发服务器),并确保 apache 和开发服务器之间没有相同的端口.
    干杯!

Hello
Am trying to run dev server using webpack encore by typing npm run dev-server, when checking the localhost:9000 is render me Cannot GET / and give that log

 「wds」: Project is running at http://localhost:9000/ 
 「wds」: webpack output is served from http://localhost:9000/build/
 「wds」: Content not from webpack is served from D:\xampp\htdocs\api-platform\public
 「wds」: 404s will fallback to /index.html 


knowing I already change package.json

"scripts": {
"dev-server": "encore dev-server --port 9000 --disable-host-check",
"dev": "encore dev",
"watch": "encore dev --watch",
"build": "encore production --progress"
},

and also take look on doc https://symfony.com/doc/current/frontend/encore/dev-server.html

Project structure
api-platform/node_modules
api-platform/public/build/entrypoints.json
api-platform/public/build/manifest.json
api-platform/package.json
api-platform/webpack.config.json

Controller

    /**
 * @Route("/", name="app")
 */
public function index()
{
    return $this->render('app/index.html.twig', []);
}

解决方案

Finally am resolving that's by subscribing a few steps.

  1. Go to package.json and add port, disable-host-check to your dev-server:

    "dev-server": "encore dev-server --port 9000 --disable-host-check",

  2. Go to the host of your app(not of dev-server) and be sure to no have the same port between apache and dev-server.
    Cheers!

这篇关于找不到 webpack encore 开发服务器/的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆