angular / angular-cli

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

1.4 issue with global scripts 'input' without having `.js` extension #7626

Closed kuncevic closed 7 years ago

kuncevic commented 7 years ago
- [x ] bug report

Versions.

@angular/cli: 1.4.0
node: 8.4.0
os: win32 x64
@angular/animations: 4.3.6
@angular/cdk: 2.0.0-beta.10
@angular/common: 4.3.6
@angular/compiler: 4.3.6
@angular/core: 4.3.6
@angular/flex-layout: 2.0.0-beta.9
@angular/forms: 4.3.6
@angular/http: 4.3.6
@angular/material: 2.0.0-beta.10
@angular/platform-browser: 4.3.6
@angular/platform-browser-dynamic: 4.3.6
@angular/router: 4.3.6
@angular/cli: 1.4.0
@angular/compiler-cli: 4.3.6
typescript: 2.4.2

Repro steps.

I always had a custom section like that:

"scripts": [
    { "input": "../node_modules/powerbi-client/dist/powerbi", "output": "powerbi", "lazy": false },
    { "input": "../node_modules/oidc-client/dist/oidc-client", "output": "oidc-client", "lazy": true }
],

Now with 1.4 version I've got an error on ng serve:

10% building modules 3/3 modules 0 activec:\Projects\work\Source\node_modules\webpack-concat-plugin\index.js:54
                        throw err;
                        ^
Error: ENOENT: no such file or directory, open 'c:\Projects\work\Source\node_modules\oidc-client\dist\oidc-client'

Mention any other details that might be useful.

In order to fix that I just added extension .js to the input value

"scripts": [
    { "input": "../node_modules/powerbi-client/dist/powerbi.js", "output": "powerbi", "lazy": false },
    { "input": "../node_modules/oidc-client/dist/oidc-client.js", "output": "oidc-client", "lazy": true }
],

Works this way. But just wonder should it just work the way it was before, without having .js extension?

RobotnickIsrael commented 7 years ago

Same here on angular/cli 1.4 I get this message about the control pack I use:

C:\Projects\Torch10\torch10-web\node_modules\webpack-concat-plugin\index.js:54 [0] [0] throw err; [0] [0] ^ [0] [0] [0] [0] Error: ENOENT: no such file or directory, open 'C:\Projects\Torch10\torch10-web\node_modules\jqwidgets-framework\jqwidgets\jqxdocking'

and it was just fine in cli 1.1 (the file does exist on this path, but it is ending with 'jqxdocking.js') I updated the scripts section in ny angular-cli.json and it fixed it.

"scripts": [
                "../node_modules/jqwidgets-framework/jqwidgets/jqxdocking.js"
]
filipesilva commented 7 years ago

Heya, I'm sorry this changed. It was never supposed to auto-add the .js extension and to be honest I did not know that was happening... we changed the way scripts are loaded to allow for uglification and sourcemaps, and the new way doesn't support auto-adding .js. We could add this manually, but since it was never my intention to have it supported I'd prefer not to.

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.