angular / angular-cli

CLI tool for Angular
https://cli.angular.dev
MIT License
26.78k stars 11.98k forks source link

ERROR in multi script-loader after updating to angular-cli 1.0.0 #5665

Closed PhilippRoessner closed 7 years ago

PhilippRoessner commented 7 years ago

Bug Report or Feature Request (mark with an x)

- [ x] bug report -> please search issues before submitting
- [ ] feature request

Versions.

@angular/cli: 1.0.0 node: 6.10.1 os: win32 x64 @angular/common: 4.0.0 @angular/compiler: 4.0.0 @angular/core: 4.0.0 @angular/forms: 4.0.0 @angular/http: 4.0.0 @angular/platform-browser: 4.0.0 @angular/platform-browser-dynamic: 4.0.0 @angular/router: 4.0.0 @angular/cli: 1.0.0 @angular/compiler-cli: 4.0.0

Repro steps.

Added "scripts": [ "../node_modules/jquery/dist/jquery.js" ] to apps[0] in .angular-cli.json to include 3rd party scripts. When I run ng build I get:

ERROR in multi script-loader!./~/jquery/dist/jquery.js script-loader

Before updating to angular-cli 1.0.0 it worked.

cliedelt commented 7 years ago

I got that too. But for styles and addons

patryk-zielinski93 commented 7 years ago

I have the same issue

anhvupham commented 7 years ago

I got same issue.

PhilippRoessner commented 7 years ago

Just want to say that this is a really critical (killer) feature of angular-cli and it's build process. If Treeshaking would also fail, I would skip angular-cli.

I am wondering (not trolling, really interessted!) how this could pass unit-tests? We don't use unit-tests ourselves, so does angular-cli development have unit tests?

EddyNll commented 7 years ago

Same here, pretty important in our software.

the-r3dshirt commented 7 years ago

We are also having similar problems, oddly installing node_modules using yarn seems to resolve the issue - not sure why?

anhvupham commented 7 years ago

Hey guys. Try to check the urls again. After checking and correct it. It works for me now. But of course, probably should have some better error message. On Tue, Apr 4, 2017 at 5:38 PM the-r3dshirt notifications@github.com wrote:

We are also having similar problems, oddly installing node_modules using yarn seems to resolve the issue - not sure why?

— You are receiving this because you commented. Reply to this email directly, view it on GitHub https://github.com/angular/angular-cli/issues/5665#issuecomment-291691591, or mute the thread https://github.com/notifications/unsubscribe-auth/AEDfwDlV7y6fCeHeu2U0rvPM4BPZgpriks5rsuKNgaJpZM4Mpd2R .

the-r3dshirt commented 7 years ago

Right found our problem, moment-timezone version change combined with a filename change and a yarn.lock referencing an earlier version of moment-timzone.

The error message in this case could use a little work showing which script/file specifically could not be loaded.

zilions commented 7 years ago

Same issue after updating to 1.0.0 and adding a new app into apps.

mmaryo commented 7 years ago

same issue

[INFO] ERROR in multi script-loader!./~/jquery/dist/jquery.min.js script-loader!./~/moment/min/moment.min.js script-loader!./~/bootstrap/dist/js/bootstrap.min.js script-loader!./~/admin-lte/dist/js/app.min.js script-loader!./~/fullcalendar/dist/fullcalendar.min.js script-loader!./~/fullcalendar/dist/locale/fr.js script-loader!./~/mapbox-gl/dist/mapbox-gl.js script-loader!./~/ng2-bs3-modal/bundles/ng2-bs3-modal.min.js script-loader!./~/ng2-bootstrap/bundles/ng2-bootstrap.umd.min.js [INFO] Module not found: Error: Can't resolve '/home/maryo/dev/project/pg2/spg22/node_modules/ng2-bootstrap/bundles/ng2-bootstrap.umd.min.js' in '/home/maryo/dev/project/pg2/spg22' [INFO] @ multi script-loader!./~/jquery/dist/jquery.min.js script-loader!./~/moment/min/moment.min.js script-loader!./~/bootstrap/dist/js/bootstrap.min.js script-loader!./~/admin-lte/dist/js/app.min.js script-loader!./~/fullcalendar/dist/fullcalendar.min.js script-loader!./~/fullcalendar/dist/locale/fr.js script-loader!./~/mapbox-gl/dist/mapbox-gl.js script-loader!./~/ng2-bs3-modal/bundles/ng2-bs3-modal.min.js script-loader!./~/ng2-bootstrap/bundles/ng2-bootstrap.umd.min.js [INFO] [INFO] ERROR in Cannot read property 'getSymbolByModule' of undefined

ghost commented 7 years ago

I've just run into the same here.

mmaryo commented 7 years ago

I do yarn upgrade and it's works

eliyas5044 commented 7 years ago

"scripts": [ "assets/js/jquery-1.10.2.min.js", "assets/js/bootstrap.min.js", ]

ERROR in multi script-loader!./src/assets/js/jquery-1.10.2.min.js script-loader!./src/assets/js/bootstrap.min.js

filipesilva commented 7 years ago

Closing as this seems to be a dependency problem that goes away when reinstalling dependencies (and making sure the paths are correct).

smatthews1999 commented 7 years ago

Not fixed at all. I just upgraded my project to @angular/cli and now every script will not load. No paths have changed.

ERROR in multi script-loader!C:/~/phaser-ce/build/phaser.js script-loader!./~/phaser-ce/build/box2d-plugin-full.js

package.json "scripts": [ "../node_modules/phaser-ce/build/phaser.js", ], What should the path be?

ramiromd commented 7 years ago

I had the same error. But, was my fault, I didn't install bootstrap with --save option. Tha correct way: npm install --save bootstrap@next

devsubhajit commented 7 years ago

I had the same issue. But I have solved it. Main error is in the scripts and css which are coming from the 'node_modules' folder. Go to '.angular-cli.json' file and delete all 'node_modules' files and manually type the path of your all SCRIPTS and CSS ..

Thanks

CormacAsGaeilge commented 7 years ago

@shaadh Could I ask you to elaborate how you fixed this issue? Do you mean delete all styles and scripts that reference files in node_modules? If so what do I replace them with?

sagarbhanushali commented 7 years ago

use bootstrap loader ... I was having same issue resolved it. run following commands.

  1. npm install --save resolve-url-loader --dev
  2. npm i --save-dev bootstrap@next bootstrap-loader tether jquery
craftpip commented 7 years ago

Any update on this? I got the same error after updating angular-cli to 1.2.0 My paths are accurate, no idea why it isn't working.

EDIT: Fixed, I missed a package.

sumit-cis commented 7 years ago

Try to update your path styles: [ "styles.css", "../node_modules/bootstrap/dist/css/bootstrap.css" ], scripts: [ "../node_modules/jquery/dist/jquery.js", "../node_modules/bootstrap/dist/js/bootstrap.js" ]

trebkenzen commented 7 years ago

i run on this same problem aswell and the 100% fix on this is the rewrite the code manually. instead of copy pasting it and edit the path. styles: [ "styles.css", "../node_modules/bootstrap/dist/css/bootstrap.css" ], scripts: [ "../node_modules/jquery/dist/jquery.js", "../node_modules/bootstrap/dist/js/bootstrap.js" ]

Mansoor-amin commented 7 years ago

have same issue

ERROR in multi script-loader!./src/~/jquery/dist/jquery.js
Module not found: Error: Can't resolve 'E:\workingDir\orders\parts and labour\Pa
rts-and-Labor1\src\node_modules\jquery\dist\jquery.js' in 'E:\workingDir\orders\
parts and labour\Parts-and-Labor1\node_modules\@angular\cli\models\webpack-confi
gs'
 @ multi script-loader!./src/~/jquery/dist/jquery.js
andreimcristof commented 7 years ago

@craftpip exactly what package did you miss?

SusannahSimon commented 7 years ago

Hello all, I've got the same issue. None of the above mentioned fixes seem to be working for me. Any ideas?

wangjunxin commented 7 years ago

I alse got the same issue.and I check the answer,i find none of the above mentioned can fix my problem, so i should give up the angualr-cli? Any ideas? ERROR in multi angular angular-route jquery Module not found: Error: Can't resolve 'angular' in 'C:\workspace\backup' @ multi angular angular-route jquery

PhilippRoessner commented 7 years ago

@wangjunxin actually I am giving up on angular-cli and shift to webpack. I am developing with Visual Studio and the tooling in the latest version is incredible good. There is a angular projecttemplate with webpack and at the moment I dig into webpack and how it works.

jishnukoottala commented 7 years ago

ERROR in multi script-loader!./src/..node_modules/jquery/dist/jquery.min.js script-loader!./~/bootstrap/dist/css/bootstrap.min. js Module not found ..

Same issue, somebody please help with this issue.

enzogain commented 7 years ago

Some changes has been made to bootstrap : https://github.com/angular/angular-cli/blob/7b8e0fa5220ef77bc95c404200cc84fb1e9a8f12/docs/documentation/stories/global-lib.md

Mansoor-amin commented 7 years ago

@jishnuk61 i used cdn link for jquery it resolve error multi script-loader..

kahanu commented 7 years ago

Holy Crap! What an ordeal! I finally got it to work. I had @angular/cli@1.0.0, and I upgraded to 1.4.1 and it worked! It probably is a good idea to upgrade your typescript version also. I upgraded my typescript to 2.4.0 from 2.3.3. Not sure if that helped, but somewhere between the two it works now.

Your paths are fine if they were working before. Don't change them, just upgrade the cli.

andresjz commented 7 years ago

First of all you need to verify if the file showed in the log exists, If It not exists you need to verify the version of this npm package, Each Npm Package has a repository normallly GitHub, where you can search for new changes, In the majority of cases you only need to update the package to the lastest version, But If the problem continue, verify recents changes on GitHub repository.

https://www.npmjs.com/

jsib0 commented 7 years ago

I tried multiple suggestion using Yarn, rm -rf node_module and npm install as a resetter, ensured path was correct, and even uninstalled/reinstalled angular/cli, but what worked for me (and is still working after more tests), is by:

1) deleting the "scripts" line entirely 2) running ng build -w 3) quitting it 4) putting back the "scripts" line including path, and it all worked again.

It not the most eloquent way to understanding the real problem, but I hope this works for those that are running out of options.

SafaaM commented 6 years ago

This is what worked for me

KararBarcha commented 6 years ago

same issue but FIXED :) if you are using "npm install bootstrap@3.3.7" to install bootstrap 3.3.7 you will face the error, MUST USE --save, "npm install bootstrap@3.3.7 --save".

and for jQuery MUST USE jQuery with small q "npm install jquery", DO NOT USE "npm install jQuery".

This is perfect solution and worked for me... :) 👍 🥇 💯

llaurama commented 6 years ago

I had the same issue and I tried this: Using "node_modules/jquery/dist/jquery.js" instead of "../node_modules/jquery/dist/jquery.js", and it worked.

nandhuems commented 5 years ago

I had same issue but fixed. Please check inside .angular-cli.json all the linked scripts files are available or not. if any one script file is not available the @ multi script-loader error will come. Properly link all the script path.

nandhuems commented 5 years ago

I had same issue but fixed. Please check inside .angular-cli.json all the linked scripts files are available or not. if any one script file is not available the @ multi script-loader error will come. Properly link all the script path.

angular-automatic-lock-bot[bot] commented 5 years ago

This issue has been automatically locked due to inactivity. Please file a new issue if you are encountering a similar or related problem.

Read more about our automatic conversation locking policy.

This action has been performed automatically by a bot.