【发布时间】:2017-12-13 14:57:51
【问题描述】:
我正在尝试调试我的 express 应用程序,我已根据 intellij 帮助文档配置了我的 IDE。但是当我运行应用程序时,该过程永远不会在断点处停止。
Intellij 版本:2017.1 波纹管是我在调试器控制台中看到的:
/Users/xxxxx/.nvm/versions/node/v8.1.2/bin/node --inspect-
brk=64692 /Users/xxxxx/Documents/WORKSPACE/acme-
web/services/acme.js
Debugger listening on ws://127.0.0.1:64692/453107ba-002c-4066-9b4c-
531e111aec87
For help see https://nodejs.org/en/docs/inspector
Debugger attached.
Waiting for the debugger to disconnect...
我的应用程序在 8080 端口上运行。
我是否遗漏了什么,任何指针都会有所帮助
编辑:
我曾尝试使用 IJ-EAP-2017.2。这在尝试调试时在控制台中给了我一个新错误。
/Users/user-xxxx/.nvm/versions/node/v8.1.2/bin/node --inspect-brk=55169 /Users/user-xxxx/Documents/WORK/acme-prj-web/src/common/pages/yyyyPage.js
Debugger listening on port 55169.
Debugger attached.
/Users/user-xxxx/Documents/WORK/acme-prj-web/src/common/pages/yyyyPage.js:1
(function (exports, require, module, __filename, __dirname) { import React, { Component, PropTypes } from "react";
^^^^^^
SyntaxError: Unexpected token import
at createScript (vm.js:53:10)
at Object.runInThisContext (vm.js:95:10)
at Module._compile (module.js:543:28)
at Object.Module._extensions..js (module.js:580:10)
at Module.load (module.js:488:32)
at tryModuleLoad (module.js:447:12)
at Function.Module._load (module.js:439:3)
at Module.runMain (module.js:605:10)
at run (bootstrap_node.js:427:7)
at startup (bootstrap_node.js:151:9)
Waiting for the debugger to disconnect...
Process finished with exit code 1
我不确定为什么我们会收到此错误,但仍在努力使调试器正常工作。
SyntaxError: Unexpected token import
at createScript (vm.js:53:10)
【问题讨论】:
-
用node正常运行时是否也会出现该错误?没有看到代码,我们不能说这里出了什么问题。
-
这不会正常发生。仅在启动调试器时才看到此错误。在项目中,我们使用 Babel、ES6 和 webpack 以及 node/express
-
您的浏览器控制台或模块加载器中是否有任何错误?您的网络应用是否按预期工作?
-
是的,我们没有在 Web 控制台中看到任何错误。该应用程序按预期工作。仅当我尝试在 intellij 中进行调试时才看到此错误。目前我正在使用 Ultimate 2017.1,我也尝试使用 2017.2-EAP
标签: node.js reactjs express intellij-idea node-inspector