Bit: @import not detected in .scss files

Created on 22 Aug 2019  Β·  12Comments  Β·  Source: teambit/bit

quite odd, but @imports are not being detected.
I am seeing at least two resolved issues about this, so I can't explain why it's happening now.

this is my code:

@import '~@bit/bit.gui.sizes';
@import '../styles.scss'

...

I added this file using:
bit add styles.scss --id catplant

Status is "ok" , even though ../styles.scss and ~@bit/bit.gui.sizes are missing:

❯ bit s            
new components
(use "bit tag --all [version]" to lock a version with all your changes)

     > catplant ... ok

and no dependencies are detected:

❯ bit show catplant
Id               β”‚ catplant                                    
─────────────────┼─────────────────────────────────────────────
Language         β”‚ javascript                                  
─────────────────┼─────────────────────────────────────────────
Main File        β”‚ src/routes/UserProfile/UserNav/styles.scss  
─────────────────┼─────────────────────────────────────────────
Dependencies     β”‚                                             
─────────────────┼─────────────────────────────────────────────
Dev Dependencies β”‚                                             
─────────────────┼─────────────────────────────────────────────
Files            β”‚ src/routes/UserProfile/UserNav/styles.scss  

the bug is not very consistent. Some things are detected:

@import '~theme/sizes';

generates this status:

     > catplant ...  issues found       
       missing packages dependencies (use your package manager to make sure all package dependencies are installed): 
          src/routes/UserProfile/UserNav/styles.scss -> ~theme, ~theme, ~theme`

any ideas why this is happening, and how to solve it?

Specifications:

  • Bit version: 14.2.4
  • Node version: 12.1.0
  • yarn version: 1.16.0
  • Platform: macOS 10.14.6
aredependencies typbug

Most helpful comment

Also when changing from .scss to sass it is working

All 12 comments

Also when changing from .scss to sass it is working

I tried switching from .scss to .sass but it didn't seem to fix, although it detects the dependency:

bit show git-hub-org-cards
╔══════════════════╀════════════════════════════════════════════════════╗
β•‘ Id               β”‚ [email protected]                            β•‘
β•Ÿβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”Όβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β•’
β•‘ Compiler         β”‚ bit.envs/compilers/[email protected]                     β•‘
β•Ÿβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”Όβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β•’
β•‘ Language         β”‚ javascript                                         β•‘
β•Ÿβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”Όβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β•’
β•‘ Main File        β”‚ src/components/GitHubOrgCards/index.js             β•‘
β•Ÿβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”Όβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β•’
β•‘ Dependencies     β”‚ [email protected]                                     β•‘
β•‘                  β”‚ [email protected]                                  β•‘
β•‘                  β”‚ react@^16.10.2                                     β•‘
β•‘                  β”‚ bulma@^0.7.5                                       β•‘
β•Ÿβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”Όβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β•’
β•‘ Dev Dependencies β”‚                                                    β•‘
β•Ÿβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”Όβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β•’
β•‘ Files            β”‚ src/components/GitHubOrgCards/index.js             β•‘
β•‘                  β”‚ src/components/GitHubOrgCards/styles.sass          β•‘
β•‘                  β”‚ src/components/GitHubOrgCards/test.js              β•‘
β•šβ•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•§β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•

bit tag --all $version
error: issues found with the following component dependencies

devth.github/[email protected]
missing packages dependencies (use your package manager to make sure all p
ackage dependencies are installed):
     src/components/GitHubOrgCards/styles.sass -> ~bulma

bulma is in my pacakge.json so I don't know why it's complaining.

@devth Can you please paste here your import statement in the styles.sass file?
@davidfirst let's check it

Yep.

@import "~bulma/sass/utilities/_all.sass";
@import "~bulma/sass/base/_all.sass";
@import "~bulma/sass/grid/columns.sass";
@import "~bulma/sass/elements/notification.sass";
@import "~bulma/sass/elements/content.sass";
@import "~bulma/sass/elements/image.sass";
@import "~bulma/sass/elements/title.sass";
@import "~bulma/sass/components/card.sass";

@GiladShoham , I have a feeling that something else is missing and it shows ~bulma by mistake. (similar to this issue https://github.com/teambit/bit/issues/2033). As you can see, in bit show it does show Bulma.

@devth , Did you add 'resolveModules` configuration into your workspace config? if so, could you copied it here?

Nope, I don't have resolveModules config. Should I?

@devth , nope. I was just thinking that this resolveModules feature caused the issue.
I'd like to try reproducing the issue. If you can add me as a collaborator to the component or send me the files it'd be great. [email protected].
When I create a new file and add all the import statements above, I don't see any issue.

➜  wp cat aaa.sass
@import "~bulma/sass/utilities/_all.sass";
@import "~bulma/sass/base/_all.sass";
@import "~bulma/sass/grid/columns.sass";
@import "~bulma/sass/elements/notification.sass";
@import "~bulma/sass/elements/content.sass";
@import "~bulma/sass/elements/image.sass";
@import "~bulma/sass/elements/title.sass";
@import "~bulma/sass/components/card.sass";%                                                                                                                                                                ➜  wp bit show aaa
╔══════════════════╀════════════════════════════════════════════════════╗
β•‘ Id               β”‚ aaa                                                β•‘
β•Ÿβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”Όβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β•’
β•‘ Language         β”‚ javascript                                         β•‘
β•Ÿβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”Όβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β•’
β•‘ Main File        β”‚ aaa.sass                                           β•‘
β•Ÿβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”Όβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β•’
β•‘ Dependencies     β”‚ bulma@^0.7.5                                       β•‘
β•Ÿβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”Όβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β•’
β•‘ Dev Dependencies β”‚                                                    β•‘
β•Ÿβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”Όβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β•’
β•‘ Files            β”‚ aaa.sass                                           β•‘
β•šβ•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•§β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•

No documentation found
➜  wp bit status
new components
(use "bit tag --all [version]" to lock a version with all your changes)

     > aaa ... ok
➜  wp

@davidfirst added you as collab on the repo and component. Working on migrate-to-cra branch:
https://github.com/devth/github-org-cards/tree/migrate-to-cra

bulma is now listed as a dependency and is not cuasing errors when trying to build/tag since I reverted from just importing compiled css to the scss. Not sure why. There's a separate issue (diff React versions, I think) preventing rendering the component in bit: https://bit.dev/devth/github/git-hub-org-cards

Feel free to add commits or whatever. Thanks!

@devth , thanks for adding me as a collaborator. I was able to clone the project, switch to migrate-to-cra branch, but not sure how to reproduce the error.
I copied the import statements to src/components/GitHubOrgCards/bulma.css file, and also tried to rename it to .sass, but still no error. Am I missing something?

Nope you’re not missing anything. I can’t reproduce now either. But I tried a bunch of different stuff between originally reproducing and the current state so somehow along the way it got fixed. I can try repoing again.

On Oct 16, 2019, at 12:37 PM, David First notifications@github.com wrote:

ο»Ώ
@devth , thanks for adding me as a collaborator. I was able to clone the project, switch to migrate-to-cra branch, but not sure how to reproduce the error.
I copied the import statements to src/components/GitHubOrgCards/bulma.css file, and also tried to rename it to .sass, but still no error. Am I missing something?

β€”
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub, or unsubscribe.

Oh ok, I got it. If you happen to reproduce the issue, I'd be glad to take a look at it.

I believe this is fixed? Doesn't happen anymore.

Was this page helpful?
0 / 5 - 0 ratings

Related issues

itaymendel picture itaymendel  Β·  10Comments

seed-of-apricot picture seed-of-apricot  Β·  21Comments

itaymendel picture itaymendel  Β·  16Comments

AlexanderKaran picture AlexanderKaran  Β·  10Comments

jimmi-joensson picture jimmi-joensson  Β·  14Comments