Glimpse / Home

Project Glimpse: Node Edition - Spend less time debugging and more time developing.
http://node.getglimpse.com
Other
252 stars 9 forks source link

create-react-app and Glimpse cause can't resolve module glimpse-agent-node/release #130

Open MrDesjardins opened 7 years ago

MrDesjardins commented 7 years ago

We are using https://github.com/Microsoft/TypeScript-React-Starter (2.5.0) who use underneath https://github.com/facebookincubator/create-react-app to handle the boilerplate for one of our projects. The project uses React (15.6.1) and Redux (3.7.2).

The documentation explains three ways to install. However, with the current setup, it seems that only the programmatically one has potential. The entry file when using the TypeScript-React-Started project is "index.tsx". I added glimpse this way:

import * as React from "react";
import * as ReactDOM from "react-dom";
import App from "./App";
import registerServiceWorker from "./registerServiceWorker";
import * as glimpse from "@glimpse/glimpse"; // ---> HERE

if (process.env.NODE_ENV !== "production") { // ---> HERE
  glimpse.init();
}

ReactDOM.render(
  <App />,
  document.getElementById("root") as HTMLElement
);
registerServiceWorker();

The code transpile, but the issue is at runtime:

./~/@glimpse/glimpse-agent-node/release/Agent.js
Module not found: Can't resolve 'module' in '/Users/pdesjardins/code/ocppui/node_modules/@glimpse/glimpse-agent-node/release