Skip to content
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

stylePreprocessorOptions not used for unit tests #4200

Closed
psurrey opened this issue Jan 24, 2017 · 3 comments
Closed

stylePreprocessorOptions not used for unit tests #4200

psurrey opened this issue Jan 24, 2017 · 3 comments

Comments

@psurrey
Copy link

psurrey commented Jan 24, 2017

Please provide us with the following information:

OS?

Mac OSX El Capitan

Versions.

Please run ng --version. If there's nothing outputted, please run in a Terminal: node --version and paste the result here:

angular-cli: 1.0.0-beta.26
node: 6.9.1
os: darwin x64
@angular/common: 2.4.4
@angular/compiler: 2.4.4
@angular/core: 2.4.4
@angular/forms: 2.4.4
@angular/http: 2.4.4
@angular/platform-browser: 2.4.4
@angular/platform-browser-dynamic: 2.4.4
@angular/router: 3.4.4
@angular/compiler-cli: 2.4.4
@angular/tsc-wrapped: 0.5.1

Repro steps.

Was this an app that wasn't created using the CLI? What change did you do on your code? etc.

Make use of the recently added "stylePreprocessorOptions" in angular-cli.json in combination with stylus (#4003).

This is my config:

"stylePreprocessorOptions": {
        "includePaths": [
          "../node_modules/bootstrap-styl",
          "../node_modules/bootstrap-styl/stylus",
          "styles"
        ]
      },

In a *.component.styl stylus file I added @import('globals') which resolves to src/styles/globals.styl. With ng serve it works, but ng test fails.

The log given by the failure.

Error: Module build failed: Error: /Users/patrick/dev/leanix-pathfinder-web/src/app/app.component.styl:1:25
     1| @require('lib/constants')
  ------------------------------^
     2|
     3| .App
     4|   padding-top: 51px

  failed to locate @require file lib/constants.styl

      at CachedPathEvaluator.visitImport (/Users/patrick/dev/leanix-pathfinder-web/node_modules/stylus-loader/lib/evaluator.js:157:21)
      at CachedPathEvaluator.Visitor.visit (/Users/patrick/dev/leanix-pathfinder-web/node_modules/stylus/lib/visitor/index.js:28:40)
      at CachedPathEvaluator.Evaluator.visit (/Users/patrick/dev/leanix-pathfinder-web/node_modules/stylus/lib/visitor/evaluator.js:160:18)
      at CachedPathEvaluator.Evaluator.visitRoot (/Users/patrick/dev/leanix-pathfinder-web/node_modules/stylus/lib/visitor/evaluator.js:707:27)
      at CachedPathEvaluator.Visitor.visit (/Users/patrick/dev/leanix-pathfinder-web/node_modules/stylus/lib/visitor/index.js:28:40)
      at CachedPathEvaluator.Evaluator.visit (/Users/patrick/dev/leanix-pathfinder-web/node_modules/stylus/lib/visitor/evaluator.js:160:18)
      at CachedPathEvaluator.Evaluator.evaluate (/Users/patrick/dev/leanix-pathfinder-web/node_modules/stylus/lib/visitor/evaluator.js:247:15)
      at Renderer.render (/Users/patrick/dev/leanix-pathfinder-web/node_modules/stylus/lib/renderer.js:86:26)
      at /Users/patrick/dev/leanix-pathfinder-web/node_modules/stylus-loader/index.js:163:12
      at tryCatchReject (/Users/patrick/dev/leanix-pathfinder-web/node_modules/when/lib/makePromise.js:840:30)
      at runContinuation1 (/Users/patrick/dev/leanix-pathfinder-web/node_modules/when/lib/makePromise.js:799:4)
      at Fulfilled.when (/Users/patrick/dev/leanix-pathfinder-web/node_modules/when/lib/makePromise.js:590:4)
      at Pending.run (/Users/patrick/dev/leanix-pathfinder-web/node_modules/when/lib/makePromise.js:481:13)
      at Scheduler._drain (/Users/patrick/dev/leanix-pathfinder-web/node_modules/when/lib/Scheduler.js:62:19)
      at Scheduler.drain (/Users/patrick/dev/leanix-pathfinder-web/node_modules/when/lib/Scheduler.js:27:9)
      at _combinedTickCallback (internal/process/next_tick.js:67:7)
      at process._tickCallback (internal/process/next_tick.js:98:9)
  at src/test.ts:279131

Mention any other details that might be useful.

I have found that in models/webpack-build-test.js the stylus-load has no configuration as it does here: https://github.com/angular/angular-cli/pull/4003/files#diff-422be7f05c4af54ddd02152bfc358260R79

I think it should be added there as well!?


Thanks! We'll be in touch soon.

@filipesilva
Copy link
Contributor

Yeap, bug. Sorry for that :/

I'll close in favor of #3605, since it's the same 'thing' so to speak.

@psurrey
Copy link
Author

psurrey commented Jan 24, 2017

Perfect, thank you.
Appreciate your work!

@angular-automatic-lock-bot
Copy link

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.

@angular-automatic-lock-bot angular-automatic-lock-bot bot locked and limited conversation to collaborators Sep 6, 2019
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

2 participants