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

Can't find stylesheet to import error on dependencies components #55

Open
JoshK2 opened this issue Sep 4, 2019 · 1 comment
Open

Can't find stylesheet to import error on dependencies components #55

JoshK2 opened this issue Sep 4, 2019 · 1 comment

Comments

@JoshK2
Copy link
Member

JoshK2 commented Sep 4, 2019

I tried to export ngx-charts project and get an error on SCSS file when I build a component A that have component B as a dependency and component B have an SCSS file inside.

Setup to reproduce

  1. clone this project https://github.com/swimlane/ngx-charts.
  2. run checkout git checkout tags/12.0.1.
  3. run npm i.
  4. run bit init.
  5. do the following change:
in file src/common/axes/y-axis-ticks.component.ts change import roundedReact to `import { roundedRect } from '../shape.helper';`
in file src/utils/types.ts change return in isDate to `return Object.prototype.toString.call(value) === '[object Date]';`
  1. run bit status, should be ok.
  2. run this bit add commands:
bit add src/*/ -e 'src/{PARENT}/*.spec.ts,src/common,src/models,src/utils' -m 'src/{PARENT}/index.ts'
bit add src/utils/* -n utils 
bit add src/models/* -n models
bit add src/events.ts

bit add src/common/*/ -n common -e 'src/common/*/*.spec.ts,src/common/area.component.ts'
bit add src/common/*.ts -n common -e 'src/common/*.spec.ts,src/common/index.ts'
bit add src/common/base-chart.component.scss -n common/style
  1. copy this to bit objects(I added permission to Doron for the compiler):
"bit": {
    "env": {
      "compiler": "joshk.ngx-charts-compiler/compilers/[email protected]"
    },
    "componentsDefaultDirectory": "components/{name}",
    "packageManager": "npm",
    "overrides": {
      "*": {
        "dependencies": {},
        "peerDependencies": {
          "d3": "^4.10.2",
          "@types/d3": "^5.7.2"
        }
      },
      "common/style/*": {
        "env": {
          "compiler": "-"
        }
      }
    }
  }
  1. run this build command: NG_DEBUG=true bit build polar-chart

And you will get this error:

error: bit failed to build polar-chart with the following exception:
Command failed: node /Users/yoshuakuttler/Documents/bit/testingAngularProjects/ngx-charts/.git/bit/components/compilers/angular/joshk.ngx-charts-compiler/0.2.2/node_modules/ng-packagr/cli/main.js -p ng-package.json -c tsconfig.json
ERROR: Can't find stylesheet to import.
  ╷
1 │ @import '~@bit/pie-chart/dist/pie-chart/pie-chart/pie-chart.component';
  │         ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  ╵
  pie-chart/pie-chart.component.scss 1:9  root stylesheet

Building Angular Package

------------------------------------------------------------------------------
Building entry point '@bit/polar-chart'
------------------------------------------------------------------------------
Compiling TypeScript sources through ngc
  • bit version: 14.2.6-dev.3
  • node version: v10.16.0
@GiladShoham
Copy link
Member

Looks like it might be the same issue as teambit/bit#1972

@qballer qballer removed their assignment Jun 19, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants