geowarin/boot-react

ERROR in Cannot find module 'stylus'

sedovalx opened this issue · 7 comments

Hi!
I'm sory for really dumb question but I have ERROR in Cannot find module 'stylus' when I try to import 'stylus/main.styl' and run bundle then. If the stylus is installed globally npm install -g stylus nothing changes, same error. But if I install it locally npm install --save-dev stylus another error arrive:

at tryCatchReject (D:\github\oauth2tester\frontend\node_modules\stylus-loader\node_modules\when\lib\makePromise.js:840:30)
at runContinuation1 (D:\github\oauth2tester\frontend\node_modules\stylus-loader\node_modules\when\lib\makePromise.js:799:4)
at Fulfilled.when (D:\github\oauth2tester\frontend\node_modules\stylus-loader\node_modules\when\lib\makePromise.js:590:4)
at Pending.run (D:\github\oauth2tester\frontend\node_modules\stylus-loader\node_modules\when\lib\makePromise.js:481:13)
at Scheduler._drain (D:\github\oauth2tester\frontend\node_modules\stylus-loader\node_modules\when\lib\Scheduler.js:62:19)
at Scheduler.drain (D:\github\oauth2tester\frontend\node_modules\stylus-loader\node_modules\when\lib\Scheduler.js:27:9)
at nextTickCallbackWith0Args (node.js:420:9)
at process._tickCallback (node.js:349:13)
@ ./src/ui/container/App.js 21:0-48

I have the same webpack.config.js, .babelrc and dev dependency on style-loader, stylus-loader, stylus. Can you give me a clue what's wrong? Thanks in advance!

Hi @sedovalx!

There are no dumb questions, don't worry.
There is no need to install stylus globally.

I see that you are using windows. I've never tested this project on a windows machine.
I wonder if it's a bug with stylus loader...

I'll try to setup CI on windows later today to make sure that the project can be built on a windows machine.

In the meantime, can you tell me which version of node/npm you are using?
Also, stylus is somewhat optional, you could probably remove the stylus-loader from the webpack configurations and load .css files, leaving the @import statements intact.

Thank you for the quick answer @geowarin!
Node version is 4.2.2.

Can you also try the following?

  • Wipe out your node_modules directory.
  • gradlew.bat fontend:npmInstall

This will install dependencies with npm3, the version specified in the gradle build.

  • Then you can try running the frontend with npm start (using your node 4)

OR

  • add the following task to the frontend build.gradle file:
task start(type: NpmTask) {
  args = ['start']
}

With this you can run the frontend with the node version specified in the gradle build (using node 5).
With gradlew.bat frontend:start

Wow! It works. So the version on the Node was wrong. Thank you very much!

Great news!
I'll update the README accordingly.
I don't really want to maintain multiple versions of node on this project :bowtie:

I've set up appveyor to build the application on a windows machine.
You can see the results here.

There is one test that appears to fail, I will have to take a look at it.
@sedovalx, since you have a windows machine can you tell me if gradlew.bat check fails in a similar fashion on your machine?

In any case, the project builds on windows, which is a relief 😄

On my machine all tests pass if I get it right. Here the whole output:

d:\github\boot-react>gradlew check
:backend:compileJava
Download https://repo1.maven.org/maven2/org/springframework/boot/spring-boot-starter-parent/1.3.2.RELEASE/spring-boot-starter-parent-1.3.2.RELEASE.pom
Download https://repo1.maven.org/maven2/org/springframework/boot/spring-boot-devtools/1.3.2.RELEASE/spring-boot-devtools-1.3.2.RELEASE.pom
Download https://repo1.maven.org/maven2/org/springframework/boot/spring-boot-starter-web/1.3.2.RELEASE/spring-boot-starter-web-1.3.2.RELEASE.pom
Download https://repo1.maven.org/maven2/org/springframework/boot/spring-boot-starters/1.3.2.RELEASE/spring-boot-starters-1.3.2.RELEASE.pom
Download https://repo1.maven.org/maven2/org/springframework/boot/spring-boot-starter-security/1.3.2.RELEASE/spring-boot-starter-security-1.3.2.RELEASE.pom
Download https://repo1.maven.org/maven2/org/springframework/session/spring-session/1.0.2.RELEASE/spring-session-1.0.2.RELEASE.pom
Download https://repo1.maven.org/maven2/org/springframework/boot/spring-boot-starter-redis/1.3.2.RELEASE/spring-boot-starter-redis-1.3.2.RELEASE.pom
Download https://repo1.maven.org/maven2/org/springframework/boot/spring-boot/1.3.2.RELEASE/spring-boot-1.3.2.RELEASE.pom
Download https://repo1.maven.org/maven2/org/springframework/boot/spring-boot-autoconfigure/1.3.2.RELEASE/spring-boot-autoconfigure-1.3.2.RELEASE.pom
Download https://repo1.maven.org/maven2/org/springframework/boot/spring-boot-starter/1.3.2.RELEASE/spring-boot-starter-1.3.2.RELEASE.pom
Download https://repo1.maven.org/maven2/org/springframework/boot/spring-boot-starter-tomcat/1.3.2.RELEASE/spring-boot-starter-tomcat-1.3.2.RELEASE.pom
Download https://repo1.maven.org/maven2/org/springframework/boot/spring-boot-starter-validation/1.3.2.RELEASE/spring-boot-starter-validation-1.3.2.RELEASE.pom
Download https://repo1.maven.org/maven2/org/springframework/data/spring-data-redis/1.6.2.RELEASE/spring-data-redis-1.6.2.RELEASE.pom
Download https://repo1.maven.org/maven2/redis/clients/jedis/2.7.3/jedis-2.7.3.pom
Download https://repo1.maven.org/maven2/org/springframework/boot/spring-boot-starter-logging/1.3.2.RELEASE/spring-boot-starter-logging-1.3.2.RELEASE.pom
Download https://repo1.maven.org/maven2/org/springframework/spring-context-support/4.2.4.RELEASE/spring-context-support-4.2.4.RELEASE.pom
Download https://repo1.maven.org/maven2/org/slf4j/slf4j-parent/1.7.13/slf4j-parent-1.7.13.pom
Download https://repo1.maven.org/maven2/org/apache/commons/commons-pool2/2.4.2/commons-pool2-2.4.2.pom
Download https://repo1.maven.org/maven2/org/springframework/boot/spring-boot-devtools/1.3.2.RELEASE/spring-boot-devtools-1.3.2.RELEASE.jar
Download https://repo1.maven.org/maven2/org/springframework/boot/spring-boot-starter-web/1.3.2.RELEASE/spring-boot-starter-web-1.3.2.RELEASE.jar
Download https://repo1.maven.org/maven2/org/springframework/boot/spring-boot-starter-security/1.3.2.RELEASE/spring-boot-starter-security-1.3.2.RELEASE.jar
Download https://repo1.maven.org/maven2/org/springframework/session/spring-session/1.0.2.RELEASE/spring-session-1.0.2.RELEASE.jar
Download https://repo1.maven.org/maven2/org/springframework/boot/spring-boot-starter-redis/1.3.2.RELEASE/spring-boot-starter-redis-1.3.2.RELEASE.jar
Download https://repo1.maven.org/maven2/org/springframework/boot/spring-boot/1.3.2.RELEASE/spring-boot-1.3.2.RELEASE.jar
Download https://repo1.maven.org/maven2/org/springframework/boot/spring-boot-autoconfigure/1.3.2.RELEASE/spring-boot-autoconfigure-1.3.2.RELEASE.jar
Download https://repo1.maven.org/maven2/org/springframework/boot/spring-boot-starter/1.3.2.RELEASE/spring-boot-starter-1.3.2.RELEASE.jar
Download https://repo1.maven.org/maven2/org/springframework/boot/spring-boot-starter-tomcat/1.3.2.RELEASE/spring-boot-starter-tomcat-1.3.2.RELEASE.jar
Download https://repo1.maven.org/maven2/org/springframework/boot/spring-boot-starter-validation/1.3.2.RELEASE/spring-boot-starter-validation-1.3.2.RELEASE.jar
Download https://repo1.maven.org/maven2/org/springframework/data/spring-data-redis/1.6.2.RELEASE/spring-data-redis-1.6.2.RELEASE.jar
Download https://repo1.maven.org/maven2/redis/clients/jedis/2.7.3/jedis-2.7.3.jar
Download https://repo1.maven.org/maven2/org/springframework/boot/spring-boot-starter-logging/1.3.2.RELEASE/spring-boot-starter-logging-1.3.2.RELEASE.jar
Download https://repo1.maven.org/maven2/org/springframework/spring-context-support/4.2.4.RELEASE/spring-context-support-4.2.4.RELEASE.jar
Download https://repo1.maven.org/maven2/org/apache/commons/commons-pool2/2.4.2/commons-pool2-2.4.2.jar
:backend:compileGroovy UP-TO-DATE
:backend:processResources
:backend:classes
:backend:compileTestJava UP-TO-DATE
:backend:compileTestGroovy
Download https://repo1.maven.org/maven2/org/springframework/boot/spring-boot-starter-test/1.3.2.RELEASE/spring-boot-starter-test-1.3.2.RELEASE.pom
Download https://repo1.maven.org/maven2/org/springframework/security/spring-security-test/4.0.3.RELEASE/spring-security-test-4.0.3.RELEASE.pom
Download https://jcenter.bintray.com/com/geowarin/spring-spock-mvc/0.2.1/spring-spock-mvc-0.2.1.pom
Download https://repo1.maven.org/maven2/org/springframework/spring-test/4.2.4.RELEASE/spring-test-4.2.4.RELEASE.pom
Download https://repo1.maven.org/maven2/org/springframework/boot/spring-boot-starter-test/1.3.2.RELEASE/spring-boot-starter-test-1.3.2.RELEASE.jar
Download https://repo1.maven.org/maven2/org/springframework/security/spring-security-test/4.0.3.RELEASE/spring-security-test-4.0.3.RELEASE.jar
Download https://jcenter.bintray.com/com/geowarin/spring-spock-mvc/0.2.1/spring-spock-mvc-0.2.1.jar
Download https://repo1.maven.org/maven2/org/springframework/spring-test/4.2.4.RELEASE/spring-test-4.2.4.RELEASE.jar
Download https://repo1.maven.org/maven2/org/codehaus/groovy/groovy-ant/2.4.4/groovy-ant-2.4.4.pom
Download https://repo1.maven.org/maven2/org/codehaus/groovy/groovy-groovydoc/2.4.4/groovy-groovydoc-2.4.4.pom
Download https://repo1.maven.org/maven2/org/apache/ant/ant-antlr/1.9.4/ant-antlr-1.9.4.pom
Download https://repo1.maven.org/maven2/org/apache/ant/ant-junit/1.9.4/ant-junit-1.9.4.pom
Download https://repo1.maven.org/maven2/org/codehaus/groovy/groovy-templates/2.4.4/groovy-templates-2.4.4.pom
Download https://repo1.maven.org/maven2/org/codehaus/groovy/groovy-xml/2.4.4/groovy-xml-2.4.4.pom
Download https://repo1.maven.org/maven2/org/codehaus/groovy/groovy-ant/2.4.4/groovy-ant-2.4.4.jar
Download https://repo1.maven.org/maven2/org/codehaus/groovy/groovy-groovydoc/2.4.4/groovy-groovydoc-2.4.4.jar
Download https://repo1.maven.org/maven2/org/apache/ant/ant-antlr/1.9.4/ant-antlr-1.9.4.jar
Download https://repo1.maven.org/maven2/org/apache/ant/ant-junit/1.9.4/ant-junit-1.9.4.jar
Download https://repo1.maven.org/maven2/org/codehaus/groovy/groovy-templates/2.4.4/groovy-templates-2.4.4.jar
Download https://repo1.maven.org/maven2/org/codehaus/groovy/groovy-xml/2.4.4/groovy-xml-2.4.4.jar
:backend:processTestResources UP-TO-DATE
:backend:testClasses
:backend:test
2016-04-14 15:25:02.145  INFO 13440 --- [       Thread-7] o.s.w.c.s.GenericWebApplicationContext   : Closing org.springframework.web.context.support.GenericWebApplicationContext@1da1f2bc: startup date [Thu Apr 14 15:24:59 MSK 2016]; root of context hierarchy
:backend:check
:frontend:nodeSetup UP-TO-DATE
:frontend:test

> boot-react-frontend@0.0.1 test D:\github\boot-react\frontend
> cross-env NODE_ENV=test mocha



    components
        ListComponent
            should render three items
            should fetch items on click

  (uses jsdom)
    components

   LoginForm
        Warning: `valueLink` prop on `input` is deprecated; set `value` and `onChange` instead.

        should call login with form data (39ms)

  (uses jsdom)

   PrivatePage

        should render loader when not authenticated
        should render the page when authenticated


  5 passing (795ms)

:frontend:check

BUILD SUCCESSFUL

Total time: 35.527 secs

Environment:

  • Windows 10
  • Node 4.4.2
  • JDK 1.8.0_66

😕