Open Muthu2020 opened 7 years ago
Hi!
Can you try like this:
{
main: 'dist/ng2-dropdown.bundle.js',
defaultExtension: 'js',
format: 'cjs'
}
Please reopen if still not working. I will add this to the documentation
Thanks @Gbuomprisco - did this but now I get a new error:
Error: Error: XHR error (404 Not Found) loading http://localhost:3000/node_modules/ng2-material-dropdown/dist/style.scss.js(…)
(I can't actually reopen this issue. Maybe this is a new issue anyway...)
Hi @jasonburrows,
In my experience this happens as systemjs tries to load with .js
extension also other files. If you add this file to the config with defaultJSExtension: false
, it should work.
@Gbuomprisco - thanks, but no I get the same error. I have tried also removing defaultExtension: 'js'
just to see if that changed things and it doesn't, same error.
Note that in my node-modules/ng2-material-dropdown directory (and all sub-dirs) there are no scss files or html files. I see them in the GitHub repo but they aren't there after running npm install --save ng2-material-dropdown
.
So these files don't exist at all, it seems, regardless of the extension it is using to try to load them.
@jasonburrows I see - but that would fine as the components are all bundled in 1 file. Though I think NPM also does not pull all files, as I actually included them in the dist directory
This is my dist folder (but again - it shouldn't matter):
So many issues with SystemJS :( Unfortunately I am not sure how to best help. If it can help I used this boilerplate (https://github.com/mgechev/angular-seed) to test the components with SystemJS
@Gbuomprisco - yeah mine is missing a massive chunk of those files. This is what is in my node_modules/ng2-material-dropdown folder:
...maybe someone else will see this and know what I should do about it! Thanks for your help.
I had the same problem as @jasonburrows. I am also using mgechev/angular-seed. I solved it with this in project.config.ts:
this.addPackageBundles({
name:'ng2-material-dropdown',
path:'node_modules/ng2-material-dropdown/dist/ng2-dropdown.bundle'
});
Yes this!
If I add this to my packages section:
I get http://localhost:3000/node_modules/ng2-material-dropdown/index.js 404 (Not Found)
...but if I add the dist folder in the path:
I get http://localhost:3000/node_modules/ng2-material-dropdown/dist/dist/src/index.js 404 (Not Found)
(notice the double 'dist'). I've tried many other combinations and haven't found anything that works.