angular-tree-component icon indicating copy to clipboard operation
angular-tree-component copied to clipboard

"lodash/defaultsDeep" systemJS Error

Open Shadowlauch opened this issue 9 years ago • 16 comments

I just rebuild my whole node_modules folder and I ran into this error message

(SystemJS) Module not already loaded loading "lodash/defaultsDeep"

I'm on angular 4.0.2 and atc 3.3.1. I also tried using atc 3.2.4 which did work in that regard.

This is my atc entry in the systemJS config:

'angular-tree-component': 'npm:angular-tree-component/dist/angular-tree-component.umd.js',

Shadowlauch avatar Apr 19 '17 15:04 Shadowlauch

I am also getting same error. Please let me know the solution.

VenkatEraga avatar Apr 19 '17 22:04 VenkatEraga

Hi all, Adding the following block to system.config.js seems to do the trick for now. I'm sure there is a better way of doing this.

    meta: {
          'angular-tree-component': {
              deps: [
                  'lodash/first.js',
                  'lodash/last.js',
                  'lodash/compact.js',
                  'lodash/find.js',
                  'lodash/includes.js',
                  'lodash/remove.js',
                  'lodash/indexOf.js',
                  'lodash/pullAt.js',
                  'lodash/pick.js',
                  'lodash/defaultsDeep.js']
          }

      },

gpapp avatar Apr 23 '17 19:04 gpapp

@gpapp I tried that but still getting the same error!

ezzkht avatar Apr 24 '17 09:04 ezzkht

I change every steps to angular2-tree-component instead of angular-tree-component and it's worked.

Install npm install --save angular2-tree-component

Add to systemjs.config.js 'angular2-tree-component': 'node_modules/angular2-tree-component/dist/angular2-tree-component.umd.js',

Import module import { TreeModule } from 'angular2-tree-component';

chanai-m avatar Apr 24 '17 16:04 chanai-m

@gpapp how the rest of your system.config file looks like? I'm still getting the same error

sohai avatar Apr 25 '17 09:04 sohai

@MonkeyDoll that's an older version of the component. You will get a warning message while installing the package.

ezzkht avatar Apr 25 '17 09:04 ezzkht

This is probably not going to help a lot, but I switched over to webpack and the problem disappeared, so it is definitely a problem related to systemjs.

Shadowlauch avatar Apr 25 '17 17:04 Shadowlauch

Hi.. can some one help me here ?? No response on the below question from the owner as well...

npm install angular-tree-component

I have installed angular-tree-component version 3.3.0 . In appmodule.ts when i try to import the Tree Module, I am not able to get the reference by just using import { TreeModule } from 'angular-tree-component';

I need to reach dist/angular-tree-component and then TreeModule can be imported. and when running the app in IE 11 , chrome this gives me an error " Unexpected Token import " .

I am using Webpack with angular version 2.4.8 .

Any suggestions ?

AngularTx avatar Apr 25 '17 17:04 AngularTx

where i can find system.config.js ? ( where is located? )

i've latest angular 4 and angular-cli

npm install --save angular-tree-component

dewolft avatar Apr 28 '17 22:04 dewolft

Hi all, Adding the following block to system.config.js seems to work for me now.

paths: {
            'npm:': 'node_modules/'
},
map: {
.....
            'lodash': 'npm:lodash',
            'angular-tree-component': 'npm:angular-tree-component/dist'
.....
},
packages: {
....
            lodash: { defaultExtension: 'js' },
            'angular-tree-component': { format: 'cjs', main: 'angular-tree-component.umd.js', defaultExtension: 'js' }
.....
}

sasinandrei avatar Apr 29 '17 08:04 sasinandrei

I have issues when using it with webpack . Any idea how it's done. I have raised issue on this, but no one has replied yet.

On Apr 29, 2017 2:23 PM, "Andrey" [email protected] wrote:

Hi all, Adding the following block to system.config.js seems to work for me now.

...... map: { ..... 'lodash': 'npm:lodash', 'angular-tree-component': 'npm:angular-tree-component/dist' ..... }, packages: { .... lodash: { defaultExtension: 'js' }, 'angular-tree-component': { format: 'cjs', main: 'angular-tree-component.umd.js', defaultExtension: 'js' } ..... }

— You are receiving this because you commented. Reply to this email directly, view it on GitHub https://github.com/500tech/angular-tree-component/issues/262#issuecomment-298156660, or mute the thread https://github.com/notifications/unsubscribe-auth/AStMS6uohZauUZPpXufkhTeEhNsOvC-Oks5r0vqTgaJpZM4NB2b8 .

AngularTx avatar Apr 29 '17 09:04 AngularTx

First of all - I recommend everyone to switch to webpack, it's much better in any case than SystemJS. Second - I added lodash to the bundle in 3.4.1. Can you check with that version?

adamkleingit avatar Apr 29 '17 13:04 adamkleingit

@adamkleingi, I tried with 3.4.1 also no luck. I could not use webpack in my project as we commited to use systemjs only. Any other possibilities.?

VenkatEraga avatar Apr 30 '17 12:04 VenkatEraga

sasinandrei's worked the key for me was missing this (I think it was the format 'cjs')

'angular-tree-component': { format: 'cjs', main: 'angular-tree-component.umd.js', defaultExtension: 'js' }

jb201 avatar May 05 '17 00:05 jb201

Thanks @sasinandrei , helped me out a lot.

roni-frantchi avatar Jul 09 '17 15:07 roni-frantchi

@sasinandrei - thanks. I dropped support for SystemJS, closing this one.

adamkleingit avatar Jul 11 '17 06:07 adamkleingit