Has anyone experienced Webpack dependency compiling issues when using the AppDynamics library? And did you find a way to work around it? I believe this is an issue stemming from their library.
When trying to install the AppDynamics package for monitoring a Node.js/Express application, our Webpack build process is not able to import a handful of dependencies. Specifically, the errors output are:
WARNING in ./node_modules/appdynamics/lib/core/agent.js 445:8-28
require.main.require is not supported by webpack.
# ./node_modules/appdynamics/index.js 1:17-44
# ./server.ts
ERROR in ./node_modules/appdynamics-zmq/lib/index.js
Module not found: Error: Can't resolve '../zmq' in '.../my-app/node_modules/appdynamics-zmq/lib'
# ./node_modules/appdynamics-zmq/lib/index.js 24:10-27
# ./node_modules/appdynamics-zmq/index.js
# ./node_modules/appdynamics/lib/libproxy/proxy-transport.js
# ./node_modules/appdynamics/lib/libproxy/libproxy.js
# ./node_modules/appdynamics/lib/core/agent.js
# ./node_modules/appdynamics/index.js
# ./server.ts
ERROR in ./node_modules/appdynamics-libagent/index.js
Module not found: Error: Can't resolve './appd_libagent' in '.../my-app/node_modules/appdynamics-libagent'
# ./node_modules/appdynamics-libagent/index.js 36:9-35
# ./node_modules/appdynamics/lib/libagent/libagent-connector.js
# ./node_modules/appdynamics/lib/core/agent.js
# ./node_modules/appdynamics/index.js
# ./server.ts
ERROR in ./node_modules/appdynamics-native/index.js
Module not found: Error: Can't resolve './appdynamics' in '.../my-app/node_modules/appdynamics-native'
# ./node_modules/appdynamics-native/index.js 29:10-34
# ./node_modules/appdynamics/lib/core/agent.js
# ./node_modules/appdynamics/index.js
# ./server.ts
ERROR in ./node_modules/appdynamics-protobuf/index.js
Module not found: Error: Can't resolve './protobuf_for_node' in '.../my-app/node_modules/appdynamics-protobuf'
# ./node_modules/appdynamics-protobuf/index.js 29:10-40
# ./node_modules/appdynamics/lib/libproxy/proxy-transport.js
# ./node_modules/appdynamics/lib/libproxy/libproxy.js
# ./node_modules/appdynamics/lib/core/agent.js
# ./node_modules/appdynamics/index.js
# ./server.ts
ERROR in ./node_modules/log4js/lib/appenders/hipchat.js
Module not found: Error: Can't resolve 'hipchat-notifier' in '.../my-app/node_modules/log4js/lib/appenders'
# ./node_modules/log4js/lib/appenders/hipchat.js 3:14-41
# ./node_modules/log4js/lib/appenders sync ^\.\/.*$
# ./node_modules/log4js/lib/log4js.js
# ./node_modules/appdynamics/lib/core/logger.js
# ./node_modules/appdynamics/lib/core/agent.js
# ./node_modules/appdynamics/index.js
# ./server.ts
ERROR in ./node_modules/log4js/lib/appenders/loggly.js
Module not found: Error: Can't resolve 'loggly' in '.../node_modules/log4js/lib/appenders'
# ./node_modules/log4js/lib/appenders/loggly.js 3:11-28
# ./node_modules/log4js/lib/appenders sync ^\.\/.*$
# ./node_modules/log4js/lib/log4js.js
# ./node_modules/appdynamics/lib/core/logger.js
# ./node_modules/appdynamics/lib/core/agent.js
# ./node_modules/appdynamics/index.js
# ./server.ts
ERROR in ./node_modules/log4js/lib/appenders/mailgun.js
Module not found: Error: Can't resolve 'mailgun-js' in '.../my-app/node_modules/log4js/lib/appenders'
# ./node_modules/log4js/lib/appenders/mailgun.js 34:14-35
# ./node_modules/log4js/lib/appenders sync ^\.\/.*$
# ./node_modules/log4js/lib/log4js.js
# ./node_modules/appdynamics/lib/core/logger.js
# ./node_modules/appdynamics/lib/core/agent.js
# ./node_modules/appdynamics/index.js
# ./server.ts
ERROR in ./node_modules/log4js/lib/appenders/smtp.js
Module not found: Error: Can't resolve 'nodemailer' in '.../my-app/node_modules/log4js/lib/appenders'
# ./node_modules/log4js/lib/appenders/smtp.js 4:13-34
# ./node_modules/log4js/lib/appenders sync ^\.\/.*$
# ./node_modules/log4js/lib/log4js.js
# ./node_modules/appdynamics/lib/core/logger.js
# ./node_modules/appdynamics/lib/core/agent.js
# ./node_modules/appdynamics/index.js
# ./server.ts
ERROR in ./node_modules/log4js/lib/appenders/slack.js
Module not found: Error: Can't resolve 'slack-node' in '.../node_modules/log4js/lib/appenders'
# ./node_modules/log4js/lib/appenders/slack.js 2:12-33
# ./node_modules/log4js/lib/appenders sync ^\.\/.*$
# ./node_modules/log4js/lib/log4js.js
# ./node_modules/appdynamics/lib/core/logger.js
# ./node_modules/appdynamics/lib/core/agent.js
# ./node_modules/appdynamics/index.js
# ./server.ts
Our project is set up with:
- Webpack v4.29.0
- Node.js v11.0.0
- Appdynamics v4.5
The Appdynamics usage is at the top of our server file as:
// AppDynamics monitoring
require("appdynamics").profile({
controllerHostName: ***
controllerPort: 443,
controllerSslEnabled: true,
accountName: ****
accountAccessKey: ***
applicationName: ***
tierName: ***
nodeName: '01'
});
And our Webpack configuration is:
const path = require('path');
const webpack = require('webpack');
module.exports = {
entry: { server: './server.ts' },
resolve: { extensions: ['.js', '.ts'] },
target: 'node',
// TO-DO: Enable "production" mode for going live with Universal
mode: 'development',
// this makes sure we include node_modules and other 3rd party libraries
externals: [/node_modules/],
output: {
path: path.join(__dirname, 'dist'),
filename: '[name].js'
},
module: {
rules: [{ test: /\.ts$/, loader: 'ts-loader' }]
},
plugins: [
]
};
So far we have tried downgrading the Webpack version, downgrading the Node environment to 10.15, and using other import methods for the AppDynamics package, but this seems like an issue internal to the Appdynamics library? The main question is, has anyone experienced Webpack dependency compiling issues when using the Appdynamics library? And did you find a way to work around it?
Any help or clues would be appreciated ❤️
The solution was adding "appdynamics" to the "externals" in the Webpack configuration: https://webpack.js.org/configuration/externals/
This allows AppDynamics to use the default Node.js require import.
Related
I installed Laravel and run npm run watch command, it returned:
ERROR in ./node_modules/destroy/index.js
Module not found: Error: Can't resolve 'fs' in 'C:\xampp\htdocs\checknpm\node_modules\destroy'
ERROR in ./node_modules/express/lib/request.js
Module not found: Error: Can't resolve 'net' in 'C:\xampp\htdocs\checknpm\node_modules\express\lib'
ERROR in ./node_modules/engine.io/lib/server.js
Module not found: Error: Can't resolve 'uws' in 'C:\xampp\htdocs\checknpm\node_modules\engine.io\lib'
Then I set some configuration in laravel webpack.mix.js:
mix.webpackConfig({
target: "node",
});
and it retuned:
WARNING in ./node_modules/socket.io/lib/index.js
113:11-32 Critical dependency: the request of a dependency is an expression
WARNING in ./node_modules/node-gyp-build/index.js
13:9-32 Critical dependency: the request of a dependency is an expression
WARNING in ./node_modules/node-gyp-build/index.js
20:15-54 Critical dependency: the request of a dependency is an expression
WARNING in ./node_modules/express/lib/view.js
81:13-25 Critical dependency: the request of a dependency is an expression
ERROR in ./node_modules/engine.io/lib/server.js
Module not found: Error: Can't resolve 'uws' in 'C:\xampp\htdocs\checknpm\node_modules\engine.io\lib'
and lastly I added:
mix.webpackConfig({
target: "node",
externals: {
uws: "uws",
ws: "ws",
},
});
when I run npm run watch it returned:
WARNING in ./node_modules/socket.io/lib/index.js
113:11-32 Critical dependency: the request of a dependency is an expression
# ./node_modules/socket.io/lib/index.js
# ./resources/js/bootstrap.js
# ./resources/js/app.js
# multi ./resources/js/app.js ./resources/sass/app.scss
WARNING in ./node_modules/express/lib/view.js
81:13-25 Critical dependency: the request of a dependency is an expression
# ./node_modules/express/lib/view.js
# ./node_modules/express/lib/application.js
# ./node_modules/express/lib/express.js
# ./node_modules/express/index.js
# ./resources/js/bootstrap.js
# ./resources/js/app.js
# multi ./resources/js/app.js ./resources/sass/app.scss
I tried different ways but it didn't work! I want to have a socket relation with Laravel however it sends me these errors and it doesn't even let me to run socket. how can I fix it?
just add this line in webpack.mix.js
target: "node",
externals: {
express: 'express',
},
After two days of fighting with the bare installation and attempting to implement the simplest of examples following a guide of Egghead.
I am having trouble with node modules finding any of its components for some reason.
Epics Index:
import { Observable } from 'rxjs';
import {combineEpics} from 'redux-observable';
function loadStoriesEpic(action$) {
return action$
.do(action => console.log(action))
.ignoreElements();
}
export const rootEpic = combineEpics(loadStoriesEpic);
My actual error on console that doesn't compiles.
RROR in ./node_modules/rxjs/Observable.js Module not found: Error:
Can't resolve 'rxjs-compat/Observable' in
'/Users/laxosceles/react-portfolio-solstice/node_modules/rxjs' #
./node_modules/rxjs/Observable.js 6:9-42 #
./node_modules/redux-observable/lib/esm/ActionsObservable.js #
./node_modules/redux-observable/lib/esm/index.js # ./src/index.js #
multi (webpack)-dev-server/client?http://localhost:8080
webpack/hot/dev-server ./src
ERROR in ./node_modules/rxjs/Subject.js Module not found: Error: Can't
resolve 'rxjs-compat/Subject' in
'/Users/laxosceles/react-portfolio-solstice/node_modules/rxjs' #
./node_modules/rxjs/Subject.js 6:9-39 #
./node_modules/redux-observable/lib/esm/createEpicMiddleware.js #
./node_modules/redux-observable/lib/esm/index.js # ./src/index.js #
multi (webpack)-dev-server/client?http://localhost:8080
webpack/hot/dev-server ./src
ERROR in ./node_modules/rxjs/observable/from.js Module not found:
Error: Can't resolve 'rxjs-compat/observable/from' in
'/Users/laxosceles/react-portfolio-solstice/node_modules/rxjs/observable'
# ./node_modules/rxjs/observable/from.js 6:9-47 #
./node_modules/redux-observable/lib/esm/ActionsObservable.js #
./node_modules/redux-observable/lib/esm/index.js # ./src/index.js #
multi (webpack)-dev-server/client?http://localhost:8080
webpack/hot/dev-server ./src
ERROR in ./node_modules/rxjs/observable/merge.js Module not found:
Error: Can't resolve 'rxjs-compat/observable/merge' in
'/Users/laxosceles/react-portfolio-solstice/node_modules/rxjs/observable'
# ./node_modules/rxjs/observable/merge.js 6:9-48 #
./node_modules/redux-observable/lib/esm/combineEpics.js #
./node_modules/redux-observable/lib/esm/index.js # ./src/index.js #
multi (webpack)-dev-server/client?http://localhost:8080
webpack/hot/dev-server ./src
ERROR in ./node_modules/rxjs/observable/of.js Module not found: Error:
Can't resolve 'rxjs-compat/observable/of' in
'/Users/laxosceles/react-portfolio-solstice/node_modules/rxjs/observable'
# ./node_modules/rxjs/observable/of.js 6:9-45 #
./node_modules/redux-observable/lib/esm/ActionsObservable.js #
./node_modules/redux-observable/lib/esm/index.js # ./src/index.js #
multi (webpack)-dev-server/client?http://localhost:8080
webpack/hot/dev-server ./src
ERROR in ./node_modules/rxjs/operator/filter.js Module not found:
Error: Can't resolve 'rxjs-compat/operator/filter' in
'/Users/laxosceles/react-portfolio-solstice/node_modules/rxjs/operator'
# ./node_modules/rxjs/operator/filter.js 6:9-47 #
./node_modules/redux-observable/lib/esm/operators.js #
./node_modules/redux-observable/lib/esm/index.js # ./src/index.js #
multi (webpack)-dev-server/client?http://localhost:8080
webpack/hot/dev-server ./src
ERROR in ./node_modules/rxjs/operator/map.js Module not found: Error:
Can't resolve 'rxjs-compat/operator/map' in
'/Users/laxosceles/react-portfolio-solstice/node_modules/rxjs/operator'
# ./node_modules/rxjs/operator/map.js 6:9-44 #
./node_modules/redux-observable/lib/esm/createEpicMiddleware.js #
./node_modules/redux-observable/lib/esm/index.js # ./src/index.js #
multi (webpack)-dev-server/client?http://localhost:8080
webpack/hot/dev-server ./src
ERROR in ./node_modules/rxjs/operator/switchMap.js Module not found:
Error: Can't resolve 'rxjs-compat/operator/switchMap' in
'/Users/laxosceles/react-portfolio-solstice/node_modules/rxjs/operator'
# ./node_modules/rxjs/operator/switchMap.js 6:9-50 #
./node_modules/redux-observable/lib/esm/createEpicMiddleware.js #
./node_modules/redux-observable/lib/esm/index.js # ./src/index.js #
multi (webpack)-dev-server/client?http://localhost:8080
webpack/hot/dev-server ./src Child html-webpack-plugin for
"index.html":
Asset Size Chunks Chunk Names
db7499f085244c16cc8c.hot-update.json 44 bytes [emitted]
+ 1 hidden asset
Entrypoint undefined = ./index.html
I do not think it has something to do with the issue, but yet I am going to say it , I recently added Yarn to my project and now I installed it with "yarn add" I do not think it should be an issue given the dependency shows in my package.json
I bet you are using rxjs v6 and redux-observable v.0.x because I see there are imports errors (that's what has been the breaking change in rxjs v6 and redux-observable v.0.x is compatible with rxjs5).
You need to upgrade redux-observable or downgrade rxjs to version 5.
A github issue.
After installing rokujs via npm, Can't seem to get past this error:
The package is installed correctly.
No other errors reported.
Any ideas?
ERROR in ./~/node-ssdp/lib/index.js
Module not found: Error: Can't resolve 'dgram' in 'C:\VisualStudio\Repos\App\App.PWA\node_modules\node-ssdp\lib'
# ./~/node-ssdp/lib/index.js 3:12-28
# ./~/node-ssdp ^.*index$
# ./~/node-ssdp/index.js
# ./~/rokujs/lib/roku.js
# ./~/rokujs/index.js
# ./ClientApp/app/components/home/home.component.ts
# ./ClientApp/app/app.shared.module.ts
# ./ClientApp/app/app.browser.module.ts
# ./ClientApp/boot.browser.ts
# multi event-source-polyfill webpack-hot-middleware/client?path=__webpack_hmr&dynamicPublicPath=true ./ClientApp/boot.browser.ts
I'm using node-ssdp to detect an IOT device connected to the network. Both server code and client code works fine with a sample node project. My client app is in angular-electron with webpack as the module bundler. I installed node-ssdp in the angular project with
npm install node-ssdp --save
node-ssdp gets installed successfully. But then webpack fails with following errors.
ERROR in ./~/node-ssdp/test/lib/server.js
Module not found: Error: Can't resolve 'chai' in 'J:\fyp\desktop-client\node_modules\node-ssdp\test\lib'
# ./~/node-ssdp/test/lib/server.js 3:13-28
# ./~/node-ssdp ^.*server$
# ./~/node-ssdp/index.js
# ./src/app/providers/pd.service.ts
# ./src/app/app.module.ts
# ./src/main.ts
# multi ./src/main.ts
ERROR in ./~/node-ssdp/test/lib/client.js
Module not found: Error: Can't resolve 'chai' in 'J:\fyp\desktop-client\node_modules\node-ssdp\test\lib'
# ./~/node-ssdp/test/lib/client.js 4:13-28
# ./~/node-ssdp ^.*client$
# ./~/node-ssdp/index.js
# ./src/app/providers/pd.service.ts
# ./src/app/app.module.ts
# ./src/main.ts
# multi ./src/main.ts
ERROR in ./~/node-ssdp/test/helper.js
Module not found: Error: Can't resolve 'sinon' in 'J:\fyp\desktop-client\node_modules\node-ssdp\test'
# ./~/node-ssdp/test/helper.js 1:12-28
# ./~/node-ssdp/test/lib/server.js
# ./~/node-ssdp ^.*server$
# ./~/node-ssdp/index.js
# ./src/app/providers/pd.service.ts
# ./src/app/app.module.ts
# ./src/main.ts
# multi ./src/main.ts
ERROR in ./~/node-ssdp/test/helper.js
Module not found: Error: Can't resolve 'dgram' in 'J:\fyp\desktop-client\node_modules\node-ssdp\test'
# ./~/node-ssdp/test/helper.js 3:12-28
# ./~/node-ssdp/test/lib/server.js
# ./~/node-ssdp ^.*server$
# ./~/node-ssdp/index.js
# ./src/app/providers/pd.service.ts
# ./src/app/app.module.ts
# ./src/main.ts
# multi ./src/main.ts
I tried installing the above missing chai, sinon, dgram dependencies manually.chai and sinon errors got eliminated but not dgram.
I did tried several times and wasted few hours on this. But I was not succeeded. Can anyone suggest a solution please?
Hi I am beginner for the Mapd database , i started to practicing the CURD Operation in mapd database its working fine, and right now i am started to working on link rendering visualization in the mapd database using the Vega , so i followed the link to the mapd to front-end connector link1 but i tried windows 10 system as well as ubuntu 14 LTS , npm version 5.0.3 and node version v8.1.3 for building "mapd-connector.js" , but unfortunately "mapd-connector.js" not building , i don't know how to do that , if any one knows how to build "mapd-connector.js" please share the link , Thank you..while building time i am getting this error.
WARNING in ./~/ws/lib/BufferUtil.js
Module not found: Error: Cannot resolve 'file' or 'directory' ../build/Release/bufferutil in /home/siftgrid/temp/mapd-connector/node_modules/ws/lib
# ./~/ws/lib/BufferUtil.js 8:19-57
WARNING in ./~/ws/lib/BufferUtil.js
Module not found: Error: Cannot resolve 'file' or 'directory' ../build/default/bufferutil in /home/siftgrid/temp/mapd-connector/node_modules/ws/lib
# ./~/ws/lib/BufferUtil.js 10:19-57
WARNING in ./~/ws/lib/Validation.js
Module not found: Error: Cannot resolve 'file' or 'directory' ../build/Release/validation in /home/siftgrid/temp/mapd-connector/node_modules/ws/lib
# ./~/ws/lib/Validation.js 8:19-57
WARNING in ./~/ws/lib/Validation.js
Module not found: Error: Cannot resolve 'file' or 'directory' ../build/default/validation in /home/siftgrid/temp/mapd-connector/node_modules/ws/lib
# ./~/ws/lib/Validation.js 10:19-57