Exécution du tutoriel sur Windows: ERROR in ./node_modules/cozy-ui/react/Button/styles.styl 1:0


#1

Bonjour:

Je suis sur Windows, and je suis le tutoriel ici

Lorsque je lance l’application:
cd mycozyapp; yarn start

J’ai l’erreur suivante:
`ERROR in ./node_modules/cozy-ui/react/Button/styles.styl 1:0
Module parse failed: Unexpected character ‘@’ (1:0)
You may need an appropriate loader to handle this file type.

@require ‘…/…/stylus/components/button’
|
| .c-btn
@ ./node_modules/cozy-ui/react/Button/index.jsx 17:0-35 29:12-18 29:61-67 29:123-129 29:183-189 29:249-255 29:319-325
@ ./src/components/Todos/TodoAdd.jsx
@ ./src/components/Todos/index.jsx
@ ./src/components/App.jsx
@ ./src/targets/browser/index.jsx
@ multi webpack-dev-server/client?http://localhost:8888/ webpack/hot/dev-server ./node_modules/babel-polyfill/lib/index.js ./node_modules/cozy-scripts/utils/reactExposer.js ./src/targets/browser/index.jsx
`

L’URL http://mycozyapp.cozy.tools:8080/ répond, mais la page est presque vide.


#2

Bonjour @prebours,

C’est étrange, on dirait que la compilation ne reconnaît pas que styles.styl est un fichier Stylus.

La dernière ligne de la documentation indique It relies on Stylus as preprocessor. You can add it as a library in your project to use it out-of-the-box. Je me demande si on précise que Stylus doit être disponible, ou si nous avons oublié de l’ajouter en dépendance, car il est déjà installé sur toutes les machines sur lesquelles nous avons testé. Peut-être pouvez-vous essayer de l’ajouter à la main…


#3

Bonjour:

J’ai lancé:
yarn global add stylus
npm install stylus -g

J’ai toujours la même erreur:
`
App successfully compiled!

Your application: http://mycozyapp.cozy.tools:8080
Your local Cozy: http://cozy.tools:8080
CouchDB: http://localhost:5984/_utils
MailHog: http://localhost:8025
Dev assets: http://localhost:8888

× 「wdm」: Hash: 955f34544cd319a04597
Version: webpack 4.29.3
Time: 7931ms
Built at: 06/11/2019 5:12:41 PM
Asset Size Chunks Chunk Names
LICENSE 33.7 KiB [emitted]
README.md 6.83 KiB [emitted]
app/mycozyapp.js 334 KiB app [emitted] app
app/mycozyapp.js.map 371 KiB app [emitted] app
icon.svg 2.2 KiB [emitted]
img/icon.svg 2.2 KiB [emitted]
index.html 1.25 KiB [emitted]
manifest.webapp 718 bytes [emitted]
public/cozy-bar.css 54.7 KiB [emitted]
public/cozy-bar.js 2.31 MiB [emitted]
public/cozy-client-js.js 726 KiB [emitted]
vendors/mycozyapp.js 2.94 MiB vendors [emitted] vendors
vendors/mycozyapp.js.map 3.31 MiB vendors [emitted] vendors
Entrypoint app = vendors/mycozyapp.js vendors/mycozyapp.js.map app/mycozyapp.js app/mycozyapp.js.map

ERROR in ./node_modules/cozy-ui/react/Button/styles.styl 1:0
Module parse failed: Unexpected character ‘@’ (1:0)
You may need an appropriate loader to handle this file type.

@require ‘…/…/stylus/components/button’
|
| .c-btn
@ ./node_modules/cozy-ui/react/Button/index.jsx 17:0-35 29:12-18 29:61-67 29:123-129 29:183-189 29:249-255 29:319-325
@ ./src/components/Todos/TodoRemoveButton.jsx
@ ./src/components/Todos/TodosList.jsx
@ ./src/components/Todos/index.jsx
@ ./src/components/App.jsx
@ ./src/targets/browser/index.jsx
@ multi webpack-dev-server/client?http://localhost:8888/ webpack/hot/dev-server ./node_modules/babel-polyfill/lib/index.js ./node_modules/cozy-scripts/utils/reactExposer.js ./src/targets/browser/index.jsx

ERROR in ./node_modules/cozy-ui/react/Input/styles.styl 1:0
Module parse failed: Unexpected character ‘@’ (1:0)
You may need an appropriate loader to handle this file type.

@require ‘…/…/stylus/components/forms’
|
| .c-input-text
@ ./node_modules/cozy-ui/react/Input/index.jsx 17:0-35 37:18-24 37:74-80 37:123-129 37:190-196
@ ./src/components/Todos/TodoAdd.jsx
@ ./src/components/Todos/index.jsx
@ ./src/components/App.jsx
@ ./src/targets/browser/index.jsx
@ multi webpack-dev-server/client?http://localhost:8888/ webpack/hot/dev-server ./node_modules/babel-polyfill/lib/index.js ./node_modules/cozy-scripts/utils/reactExposer.js ./src/targets/browser/index.jsx

ERROR in ./node_modules/cozy-ui/react/Label/styles.styl 1:0
Module parse failed: Unexpected character ‘@’ (1:0)
You may need an appropriate loader to handle this file type.

@require ‘…/…/stylus/components/forms’
|
| .c-label
@ ./node_modules/cozy-ui/react/Label/index.jsx 11:0-35 20:18-24 20:57-63
@ ./src/components/Todos/TodoAdd.jsx
@ ./src/components/Todos/index.jsx
@ ./src/components/App.jsx
@ ./src/targets/browser/index.jsx
@ multi webpack-dev-server/client?http://localhost:8888/ webpack/hot/dev-server ./node_modules/babel-polyfill/lib/index.js ./node_modules/cozy-scripts/utils/reactExposer.js ./src/targets/browser/index.jsx

ERROR in ./node_modules/cozy-ui/react/Layout/styles.styl 1:0
Module parse failed: Unexpected character ‘@’ (1:0)
You may need an appropriate loader to handle this file type.

@require ‘…/…/stylus/objects/layouts’
|
| .o-layout
@ ./node_modules/cozy-ui/react/Layout/Layout.jsx 32:0-35 41:31-37 41:52-58
@ ./node_modules/cozy-ui/react/Layout/index.js
@ ./src/components/App.jsx
@ ./src/targets/browser/index.jsx
@ multi webpack-dev-server/client?http://localhost:8888/ webpack/hot/dev-server ./node_modules/babel-polyfill/lib/index.js ./node_modules/cozy-scripts/utils/reactExposer.js ./src/targets/browser/index.jsx

ERROR in ./node_modules/cozy-ui/react/Spinner/styles.styl 1:0
Module parse failed: Unexpected character ‘@’ (1:0)
You may need an appropriate loader to handle this file type.

@require ‘…/…/stylus/settings/palette’
| @require ‘…/…/stylus/settings/icons’
| @require ‘…/…/stylus/tools/mixins’
@ ./node_modules/cozy-ui/react/Spinner/index.jsx 12:0-35 24:18-24 24:71-77 24:130-136 24:193-199 24:259-265
@ ./src/components/Todos/index.jsx
@ ./src/components/App.jsx
@ ./src/targets/browser/index.jsx
@ multi webpack-dev-server/client?http://localhost:8888/ webpack/hot/dev-server ./node_modules/babel-polyfill/lib/index.js ./node_modules/cozy-scripts/utils/reactExposer.js ./src/targets/browser/index.jsx

ERROR in ./node_modules/cozy-ui/react/Icon/styles.styl 1:0
Module parse failed: Unexpected character ‘@’ (1:0)
You may need an appropriate loader to handle this file type.

@require ‘settings/icons.styl’
|
| .icon
@ ./node_modules/cozy-ui/react/Icon/index.jsx 16:0-35 59:32-38 59:75-81
@ ./src/components/App.jsx
@ ./src/targets/browser/index.jsx
@ multi webpack-dev-server/client?http://localhost:8888/ webpack/hot/dev-server ./node_modules/babel-polyfill/lib/index.js ./node_modules/cozy-scripts/utils/reactExposer.js ./src/targets/browser/index.jsx
`


#4

Bonjour @prebours, désolé pour ce délai de réponse mais il y a avait du boulot sur CCA à faire pour publier la version qui était sur master beaucoup plus à jour que la version v1 sur npm.
Du coup, bonne nouvelle, la version v2 apporte vient juste de sortir, apporte pas mal de choses mais surtout a toutes ses dépendances à jour.
Est ce que tu pourrais retenter avec la toute dernière version sortie pour voir si ton problème serait résolu? Refaire un yarn create cozy-app mycozyapp devrait automatiquement utiliser la toute dernière version.