Open Bradleycorn opened 7 years ago
You need to add the entry of 'util' in the systemjs.config.js of the demo app.
Like so?
map: {
'util': 'node_modules/util',
// ... additional maps ...
}
I tried that ... it didn't work.
also tried setting the path to node_modules/util/util.js
, still didn't work.
Also tried adding an entry to packages
for util, still didn't work.
Hi,
Could you post the error after you adding
'util': 'node_modules/util/util.js'
entry into the 'map' section of the systemjs.config.js inside of the demo app?
Btw since 'util' is something your lib component directly depended on, it should be in the 'dependencies' of the package.json not 'devdependencies'.
I guess 'npm install util --save' instead of 'npm install util --save-dev'.
@Bradleycorn I faced the same problem and what worked for me was to add the dependency under the "paths" key in systemjs.config.js, rather than the "map" key:
paths: {
// ...
'util': 'node_modules/util',
// ... others
},
Steps to reproduce:
npm install
npm install --save-dev util
/src/lib/src/component/lib.component.ts
file with:and give the component a constructor as follows:
npm start
The app doesn't load, and the console gives errors about not being able to find util.
How can we use 'util' with the demo project?