-
Notifications
You must be signed in to change notification settings - Fork 12k
maintain the scripts order as per the angular-cli.json configuration #3782
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Comments
@filipesilva could you look into this? I was under the impression we did respect the order already. |
Ok this is a really bad bug. Will look into it. |
Heya, I was looking into this and as far as I can tell, we do respect the order. This is what I did:
This is what I saw in my console: I also checked the built
I looked a bit more, and it's actually failing on this line:
Turns out that I added it to the scripts array and it seems to get rid of the error:
I don't know if this is enough to make the plugin work though. I couldn't fine instructions to load it correctly from npm, but this should be enough to get you going on the right direction. |
My mistake. |
I had the same problem with
This was working on angular-cli 1.0.0-beta.17, but when I upgraded to beta.24, this stopped working. Error it was giving me was that My workaround was to import moment from within typescript as I didn't require it to be global (maybe for the best in the end). I'm posting here as general information that there is a change in the cli/webpack that doesn't behave as it used to with 3rd party libraries. |
@jppellerin your issue is #2141 I think, fixed by #3814 (not merged yet). |
I feel like an idiot bringing this up again, since this has been verified fixed twice, but I'm seeing this behavior in @angular/cli 1.0.4.
The three moonshine packages need to be included in that order, but most of the time they aren't. The order seems variable, each time I run ng build or ng serve. I've tried adding a console.log(); to the start of each file, to observe the order changing. I've looked at scripts.bundle.js directly on disk, and in the browser. I've purged my browser cache and done a hard reset. If I am being an idiot, I apologize. I'm pretty sure I've eliminated all the explanations mentioned above. |
@bmcbarron trying to repro with your example and latest CLI. I installed I always got the same results every run:
|
@filipesilva yep, you're right. For posterity, I was tripped up by this combo: Thanks for the sanity check! |
@bmcbarron glad you got it sorted 👍 |
Hey Guys I just have a question . I was including boostrap 4 modal and had included script files in my angular cli script array but the modal was not working . It just was not getting opened. But as soon as I did ng bulild miraculously everything started working . Could any one explain why?
|
@parijat129 I think |
Using vis.js and materialize I get this error :
In package.json :
In angular-cli.json
I checked that hammerjs, jquery, vis.js and materialize were correctly installed and present in /node_modules directory hammerjs, jquery and materialize were already installed and working in the project. Which is a simple web site. I don't see any issue appart from the fact that the scripts order could be messed up at some point ? |
@yume117 have you tried putting vis before materialize? almende/vis#2000 |
Yes I tried, I also tried to download vis.js and vis.css, put it in assets folder and load it in index.html (like cdnjs) I get the same result |
This issue has been automatically locked due to inactivity. Read more about our automatic conversation locking policy. This action has been performed automatically by a bot. |
OS?
Windows 10
Versions.
angular-cli: 1.0.0-beta.24
node: 6.9.2
os: win32 x64
Repro steps.
My
angular-cli.json
has the following:The log given by the failure.
At https://github.com/trentrichardson/jQuery-Timepicker-Addon/blob/master/dist/jquery-ui-timepicker-addon.js#L15 I get Uncaught TypeError: Cannot read property 'timepicker' of undefined. I found this is because webpack is loading the scripts in the following order:
-jquery-ui-timepicker-addon.js
-widget.js
-datepicker.js
widget.js needs to load before jquery-ui-timepicker-addon.js. Why dose webpack not load in the same order as the configuration and how do you determine the order the files load?
Mention any other details that might be useful.
http://stackoverflow.com/questions/39964281/how-to-order-angular-cli-scripts
The text was updated successfully, but these errors were encountered: