question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Not able to reproduce simple (older) code with latest angular-cli

See original GitHub issue

Hello together!

Following problem: I’m not able to reproduce this plunkr: http://embed.plnkr.co/Ua7aZsQd3Gf74oXfXigq/preview

My version can be accessed on: https://drive.google.com/open?id=1wAjf9Px3GA71jw7pKAa5FYbX9JaNTmci, but I have stripped off angular-module directory in order to get reasonably file size.

Versions


    _                      _                 ____ _     ___
   / \   _ __   __ _ _   _| | __ _ _ __     / ___| |   |_ _|
  / △ \ | '_ \ / _` | | | | |/ _` | '__|   | |   | |    | |
 / ___ \| | | | (_| | |_| | | (_| | |      | |___| |___ | |
/_/   \_\_| |_|\__, |\__,_|_|\__,_|_|       \____|_____|___|
               |___/

Angular CLI: 1.6.8
Node: 8.9.4
OS: win32 x64
Angular: 5.2.4
... animations, common, compiler, compiler-cli, core, forms
... http, language-service, platform-browser
... platform-browser-dynamic, router

@angular/cli: 1.6.8
@angular-devkit/build-optimizer: 0.0.42
@angular-devkit/core: 0.0.29
@angular-devkit/schematics: 0.0.52
@ngtools/json-schema: 1.1.0
@ngtools/webpack: 1.9.8
@schematics/angular: 0.1.17
typescript: 2.5.3
webpack: 3.10.0

Repro steps

  1. ng new angular-modal-form
  2. Download project from http://embed.plnkr.co/Ua7aZsQd3Gf74oXfXigq/preview
  3. Unpack zip-File to src and modify in scripts and ng-app all “modalApp” --> “App”

Now we get:

index.html:1 Refused to apply style from ‘http://localhost:3456/style.css’ because its MIME type (‘text/html’) is not a supported stylesheet MIME type, and strict MIME checking is enabled. index.html:12 GET http://localhost:3456/angular-modal-form.js net::ERR_ABORTED index.html:13 GET http://localhost:3456/script.js net::ERR_ABORTED index.html:1 Refused to apply style from ‘http://localhost:3456/style.css’ because its MIME type (‘text/html’) is not a supported stylesheet MIME type, and strict MIME checking is enabled. index.html:12 GET http://localhost:3456/angular-modal-form.js net::ERR_ABORTED index.html:13 GET http://localhost:3456/script.js 404 (Not Found) core.js:3683 Angular is running in the development mode. Call enableProdMode() to enable the production mode.

So, outcommeted lines

<script src="angular-modal-form.js"></script> <script src="script.js"></script>

and add scripts to .angular-cli.json like: … “scripts”: [ “angular-modal-form.js”, “script.js” ], …

(I have also tried “./…”)

we get only:

Refused to apply style from ‘http://localhost:3456/style.css’ because its MIME type (‘text/html’) is not a supported stylesheet MIME type, and strict MIME checking is enabled. core.js:3683 Angular is running in the development mode. Call enableProdMode() to enable the production mode. The last error is not dramatically, because style.css contains nothing important.

Observed behavior

Click on buttons does not results in opening modal dialog like on http://embed.plnkr.co/Ua7aZsQd3Gf74oXfXigq/preview

Desired behavior

Modal dialogs should pop-up.

Many thanks for your help!

Issue Analytics

  • State:closed
  • Created 6 years ago
  • Comments:5 (1 by maintainers)

github_iconTop GitHub Comments

1reaction
Broccocommented, Feb 12, 2018

Including external script files in a build is part of the wiki, you can find that information here: https://github.com/angular/angular-cli/wiki/stories-global-scripts

0reactions
angular-automatic-lock-bot[bot]commented, Sep 8, 2019

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.

Read more comments on GitHub >

github_iconTop Results From Across the Web

'ng' is not recognized as an internal or external command
angular -cli is older version, for new version first npm uninstall -g angular-cli npm ... Simple executing below command should do the trick....
Read more >
How to generate apps with older @angular/cli versions
10 for Angular 4 for example) in that package. json . Then run ng new testapp . Then the global CLI will use...
Read more >
Upgrade Syncfuion Version Problem | Angular - EJ 2 Forums
I have updated syncfusion all control which i am using in my project to latest version and also updated angular version 8 to...
Read more >
Angular | IntelliJ IDEA Documentation - JetBrains
The recommended way to start building a new Angular application is Angular CLI, which IntelliJ IDEA downloads and runs for you using npx....
Read more >
Migrating an Angular CLI project to Nx
If you are using older versions of Angular (version 14 or lower), make sure to use the appropriate version of Nx that matches...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found