Closed maclean-stu closed 4 years ago
Working with @apaparazzi0329 he determined that we needed to add an additional configuration in the node: section of the webpack configuration file. eg
'use strict';
module.exports = { mode: 'development', entry: './public/client.js', output: { filename: 'bundle.js', }, node: { // see http://webpack.github.io/docs/configuration.html#node // and https://webpack.js.org/configuration/node/ fs: 'empty', net: 'empty', tls: 'empty', module: 'empty' }, };
The above corrected the issue as per the example. Doco should be updated. However it only works for the '2016-05-19' version of the tone api. It fails if I try and use the current version of the api '2017-09-21'. This should be a defect as customers using these examples will generally use the current version of the api.
The example does in fact work with the current version of the api and the confusion was from different response definitions from the differing versions
Yep, more text did the trick....
Using the code from the webpack example here https://github.com/watson-developer-cloud/node-sdk/tree/master/examples/webpack I get a failed to compile error
ERROR in ./node_modules/stack-utils/index.js Module not found: Error: Can't resolve 'module' in '/Users/sjm/Box Sync/Demos/app-stt-test/node_modules/stack-utils' @ ./node_modules/stack-utils/index.js 6:2-19 @ ./node_modules/jest-message-util/build/index.js @ ./node_modules/expect/build/toThrowMatchers.js @ ./node_modules/expect/build/index.js @ ./node_modules/ibm-cloud-sdk-core/lib/sdk-test-helpers.js @ ./node_modules/ibm-cloud-sdk-core/index.js @ ./node_modules/ibm-watson/tone-analyzer/v3.js @ ./public/client.js ℹ 「wdm」: Failed to compile.