Skip to content
This repository has been archived by the owner on Jan 15, 2021. It is now read-only.

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

Open
MrDesjardins opened this issue Sep 8, 2017 · 0 comments

Comments

@MrDesjardins
Copy link

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
  • Node version: 8.1.4
  • Operating System: MacOs Sierra 10.12.5
  • Stack:
getmac.js:4 Uncaught Error: Cannot find module "child_process"
    at webpackMissingModule (getmac.js:4)
    at Object.<anonymous> (getmac.js:4)
    at Object.win (getmac.js:61)
    at __webpack_require__ (bootstrap 5bfba8a81ae54d49ac2f:659)
    at fn (bootstrap 5bfba8a81ae54d49ac2f:85)
    at Object.<anonymous> (TelemetryAppInstanceData.js:7)
    at Object.defineProperty.value (TelemetryAppInstanceData.js:79)
    at __webpack_require__ (bootstrap 5bfba8a81ae54d49ac2f:659)
    at fn (bootstrap 5bfba8a81ae54d49ac2f:85)
    at Object.<anonymous> (index.js:14)
    at __webpack_require__ (bootstrap 5bfba8a81ae54d49ac2f:659)
    at fn (bootstrap 5bfba8a81ae54d49ac2f:85)
    at Object.module.exports (ContextManagerBase.js:4)
    at __webpack_require__ (bootstrap 5bfba8a81ae54d49ac2f:659)
    at fn (bootstrap 5bfba8a81ae54d49ac2f:85)
    at Object.setPrototypeOf.__proto__ (ContextManagerContinuationLocalStorage.js:13)
    at __webpack_require__ (bootstrap 5bfba8a81ae54d49ac2f:659)
    at fn (bootstrap 5bfba8a81ae54d49ac2f:85)
    at Object.<anonymous> (ContextManagerProvider.js:3)
    at Object.defineProperty.value (ContextManagerProvider.js:73)
    at __webpack_require__ (bootstrap 5bfba8a81ae54d49ac2f:659)
    at fn (bootstrap 5bfba8a81ae54d49ac2f:85)
    at Object.defineProperty.value (index.js:7)
    at __webpack_require__ (bootstrap 5bfba8a81ae54d49ac2f:659)
    at fn (bootstrap 5bfba8a81ae54d49ac2f:85)
    at Object.<anonymous> (index.js:1)
    at __webpack_require__ (bootstrap 5bfba8a81ae54d49ac2f:659)
    at fn (bootstrap 5bfba8a81ae54d49ac2f:85)
    at Object.<anonymous> (index.tsx:8)
    at __webpack_require__ (bootstrap 5bfba8a81ae54d49ac2f:659)
    at fn (bootstrap 5bfba8a81ae54d49ac2f:85)
    at Object.<anonymous> (fetch.js:461)
    at __webpack_require__ (bootstrap 5bfba8a81ae54d49ac2f:659)
    at bootstrap 5bfba8a81ae54d49ac2f:708
    at bundle.js:712
webpackMissingModule @ getmac.js:4
(anonymous) @ getmac.js:4
win @ getmac.js:61
__webpack_require__ @ bootstrap 5bfba8a81ae54d49ac2f:659
fn @ bootstrap 5bfba8a81ae54d49ac2f:85
(anonymous) @ TelemetryAppInstanceData.js:7
Object.defineProperty.value @ TelemetryAppInstanceData.js:79
__webpack_require__ @ bootstrap 5bfba8a81ae54d49ac2f:659
fn @ bootstrap 5bfba8a81ae54d49ac2f:85
(anonymous) @ index.js:14
__webpack_require__ @ bootstrap 5bfba8a81ae54d49ac2f:659
fn @ bootstrap 5bfba8a81ae54d49ac2f:85
module.exports @ ContextManagerBase.js:4
__webpack_require__ @ bootstrap 5bfba8a81ae54d49ac2f:659
fn @ bootstrap 5bfba8a81ae54d49ac2f:85
Object.setPrototypeOf.__proto__ @ ContextManagerContinuationLocalStorage.js:13
__webpack_require__ @ bootstrap 5bfba8a81ae54d49ac2f:659
fn @ bootstrap 5bfba8a81ae54d49ac2f:85
(anonymous) @ ContextManagerProvider.js:3
Object.defineProperty.value @ ContextManagerProvider.js:73
__webpack_require__ @ bootstrap 5bfba8a81ae54d49ac2f:659
fn @ bootstrap 5bfba8a81ae54d49ac2f:85
Object.defineProperty.value @ index.js:7
__webpack_require__ @ bootstrap 5bfba8a81ae54d49ac2f:659
fn @ bootstrap 5bfba8a81ae54d49ac2f:85
(anonymous) @ index.js:1
__webpack_require__ @ bootstrap 5bfba8a81ae54d49ac2f:659
fn @ bootstrap 5bfba8a81ae54d49ac2f:85
(anonymous) @ index.tsx:8
__webpack_require__ @ bootstrap 5bfba8a81ae54d49ac2f:659
fn @ bootstrap 5bfba8a81ae54d49ac2f:85
(anonymous) @ fetch.js:461
__webpack_require__ @ bootstrap 5bfba8a81ae54d49ac2f:659
(anonymous) @ bootstrap 5bfba8a81ae54d49ac2f:708
(anonymous) @ bundle.js:712
proxyConsole.js:56 ./~/@glimpse/glimpse-agent-node/release/Agent.js
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant