Blueprint: Incorrect paths for @blueprintjs source maps that produce multiple warnings on project compilation

Created on 26 Apr 2019  路  3Comments  路  Source: palantir/blueprint

Environment

  • __Package version(s)__: @blueprintjs/[email protected]
  • __Browser and OS versions__: Chrome 73.0.3683.86, OS X 10.14.4

If possible, link to a minimal repro: https://github.com/newtriks/bp_example

Steps to reproduce

  1. npm install --save @blueprintjs/core @blueprintjs/datetime
  2. cd node_modules/@blueprintjs/datetime/lib/css/
  3. Check path in blueprint-datetime.css.map for _variables.scss
  4. Using path list dir for _variables.scss e.g. ls ../../../../node_modules/@blueprintjs/core/src/common/

Actual behavior

Output: ls: ../../../../node_modules/@blueprintjs/core/src/common/: No such file or directory

This was discovered by all the warnings on compilation of the project:

Screenshot 2019-04-26 at 14 07 43

Expected behavior

Outputs files in the common directory e.g. the source map points to the correct file

Possible solution

Step up another directory e.g. ls ../../../../../node_modules/@blueprintjs/core/src/common/

Output:

_color-aliases.scss             alignment.ts                    intent.ts
_colors.scss                    boundary.ts                     interactionMode.ts
_flex.scss                      classes.ts                      keys.ts
_mixins.scss                    colors.ts                       position.ts
_react-transition.scss          constructor.ts                  props.ts
_variables.scss                 elevation.ts                    utils
abstractComponent.ts            errors.ts                       utils.ts
abstractPureComponent.ts        index.ts

Seems the same as this closed issue: https://github.com/palantir/blueprint/issues/2728

tooling P3 bug help wanted

Most helpful comment

Experiencing same issue using [email protected]

All 3 comments

I did some research on this, and this behavior is caused by the monorepo structure of the blueprint repository.

I was unable to find a straightforward solution to fix this. One solution is to "patch" the blueprintjs.css.map file to replace the entries referencing the wrong node_modules location, but this may be "hacky", if another solution exists.

One could create a pre-release-script f. eks that would transform (showing only the entries at fault):

{
  "version": 3,
  "sources": [

    "../../../../node_modules/@blueprintjs/icons/src/_icons.scss",

    "../../../../node_modules/@blueprintjs/icons/src/generated/_icon-variables.scss",

    "../../../../node_modules/@blueprintjs/core/src/common/_react-transition.scss",
  ],
  "names": [],
  "file": "blueprint.css"
}

into

{
  "version": 3,
  "sources": [

    "../../../../../node_modules/@blueprintjs/icons/src/_icons.scss",

    "../../../../../node_modules/@blueprintjs/icons/src/generated/_icon-variables.scss",

    "../../../../node_modules/@blueprintjs/core/src/common/_react-transition.scss",
  ],
  "names": [],
  "file": "blueprint.css"
}

If this would be an acceptable solution, I would be happy to put in the time to implement it.

I just encountered the same issue using Parcel.

Any update on this? Any workaround?

Experiencing same issue using [email protected]

Was this page helpful?
0 / 5 - 0 ratings

Related issues

vladeck picture vladeck  路  32Comments

NickyYo picture NickyYo  路  18Comments

basarat picture basarat  路  17Comments

romanr picture romanr  路  67Comments

Binck360 picture Binck360  路  25Comments