Cannot use with webpack
paulsouche opened this issue · comments
Paul Souche commented
Hi,
import * as analytics from '@segment/analytics.js-core';
Fails with webpack. Warning
WARNING in /node_modules/@segment/analytics.js-core/lib/index.js
15:20-27 Critical dependency: require function is used in a way in which dependencies cannot be statically extracted
Because of this line transpiled into
analytics.require = !(function webpackMissingModule() { var e = new Error("Cannot find module \".\""); e.code = 'MODULE_NOT_FOUND'; throw e; }());
Everything works fine without it. If this is deprecated could you please remove it ? Do you need a PR for it ?
Will have a look at ContextReplacementPlugin
because seems related to webpack/webpack#2670 and webpack/webpack#2675
Alex Lévy commented
+1 Same issue here
Prateek Srivastava commented
Docs on using analytics.js can be found here https://segment.com/docs/sources/website/analytics.js/. Webpack is not currently supported.
dsjackins commented
Closing this issue. If this is still a problem, please reopen so that we can get it properly reprioritized.