-
Notifications
You must be signed in to change notification settings - Fork 11
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
Improve error message when attempting to migrate code with unmigrated third-party dependencies #127
Comments
Do you happen to refer to any Sass members that start with a dash or underscore and were defined by Bootstrap within your code? I'm guessing that's the most likely culprit for this error. |
I'll have to check in the morning, it's been a busy week and forgot to
follow up to see if you had any questions.
…On Fri, Nov 22, 2019 at 9:56 PM Jennifer Thakar ***@***.***> wrote:
Do you happen to refer to any Sass members that start with a dash or
underscore and were defined by Bootstrap within your code? I'm guessing
that's the most likely culprit for this error.
—
You are receiving this because you authored the thread.
Reply to this email directly, view it on GitHub
<#127?email_source=notifications&email_token=AK6V7OXG5T6FCWQADJKWE2DQVBISRA5CNFSM4JP7UB52YY3PNVWWK3TUL52HS4DFVREXG43VMVBW63LNMVXHJKTDN5WW2ZLOORPWSZGOEE67R5Y#issuecomment-557709559>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/AK6V7OSJKY5LOXFMD73H4YLQVBISRANCNFSM4JP7UB5Q>
.
|
We aren't doing so directly, below is my empty search results for the solution (It's an old ASP.NET WebForms project, hence the VS screen). 'dist' and 'node_modules; are not in the solution path and scss (seen above) is present completely - we're using webpack to run the SASS compilation in a pre-build MSBuild step. Searching for If that is still potentially the issue, variables.scss in bootstrap does use |
It's worth noting that I have now manually migrated the codebase from |
I seem to be having a similar issue with all of my node_modules imports. Here's a minimal repro though: //theme.scss
$primary: gold;
@import "~bootstrap/scss/bootstrap";
.golden {
color: theme-color('primary');
} //main.scss
@import "theme"; Running
Adding entire Bootstrap |
Same issue I have with
Replaced to
Decided to not proceed with the migration. |
The problem with doing this task of adding to the command line is that the migrator should recognise that bootstrap is a dependency and not convert those particular imports, regardless of where they came from. Even if the solution basically means it does a re-export of the relevant code for namespacing reasons. |
Yeah, the migrator's current behavior when dependencies aren't migrated is non-ideal. Our general recommendation is that users wait to migrate until all of their dependencies have migrated, as libraries may remove prefixes / implicit dependencies when migrating and rely on import-only files to avoid breaking users. Support for migrating only certain imports is something we could look into though. |
I have the same issue as OP. The sass migrator tool shows them using bootstrap, but I can never get it to work. Its the same exact error as OP.
This is with the latest bootstrap v5, sass package, and sass-migrator tool. Did this ever get fixed, or is node_modules bootstrap package just not going to work with sass-migrator? what am i doing wrong? here is most of my index.scss before the migrator tool is run
|
Sorry for the delay responding here. Ultimately, the issue is that you're attempting to migrate code that depends on an unmigrated third-party library via multiple entrypoints, which isn't really possible (while it's possible to migrate code depending on an unmigrated library in simple cases, it's not always possible in more complex cases like this). Retargeting this issue to give a more useful error message. |
As discussed in sass/sass#2575, there appears to be an issue with
sass-migrator module --verbose --dry-run --migrate-deps
wanting to rename~
- prefixed imports.Here's a minimum example that hopefully reproduces:
vendors.scss:
main.scss:
The error I receive is
C:\Users\fdomville\Git\redacted-project\>sass-migrator module --verbose --dry-run --migrate-deps scss\main.scss Error: The migrator wants to rename a member in node_modules\bootstrap\scss\_functions.scss, but it is not being migrated. You should re-run the migrator with --migrate-deps or with node_modules\bootstrap\scss\_functions.scss as one of your entrypoints. Migration failed!
The text was updated successfully, but these errors were encountered: