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

Fix local webpack compilation #905

Merged
merged 1 commit into from
Mar 17, 2021
Merged

Fix local webpack compilation #905

merged 1 commit into from
Mar 17, 2021

Conversation

solebared
Copy link
Collaborator

@solebared solebared commented Mar 17, 2021

Why

It appears that #897 broke webpack compilation locally (dev, test), at least on my machine, failing with:
Error: Node Sass does not yet support your current environment: OS X 64-bit with Unsupported runtime (83)

Some research led me to rails/webpacker#2716 which has been merged into webpacker 6 but not backported into our current version.

How

This changeset manually overrides the sass-loader implementation from node-sass to sass, as described in this article.

Next Steps

Left a FIXME comment in config/webpack/environment.js to remove this workaround when we upgrade to webpacker 6.

Outstanding Questions, Concerns and Other Notes

?

Pre-Merge Checklist

  • Documentation and comments have been added to the codebase where required
  • Outstanding questions and concerns have been resolved
  • Any next steps have been turned into Issues or Discussions as appropriate

@solebared
Copy link
Collaborator Author

/cc @sharvy , fyi.

See https://mentalized.net/journal/2019/10/19/use-sass-modules-in-rails/
for details.

Without this override, webpack compilation on local was failing with
`Error: Node Sass does not yet support your current environment`.

This workaround can be dropped when we upgrade to webpacker 6+.
@solebared solebared force-pushed the switch-to-dart-sass branch from 7cbb351 to 0fef1f7 Compare March 17, 2021 03:52
@solebared solebared changed the title Override webpack sass-loader from deprecated node-sass -> sass Fix local webpack compilation Mar 17, 2021
@sharvy
Copy link
Contributor

sharvy commented Mar 17, 2021

@exbinary This looks great! +1 for dart-sass.

I think you should create the issue Upgrade to Webpacker 6 and mention about this patch, so that whoever takes that issue, instantly knows about it.

@solebared
Copy link
Collaborator Author

I think you should create the issue Upgrade to Webpacker 6 and mention about this patch, so that whoever takes that issue, instantly knows about it.

Good thinking! Tracked in #906

@solebared
Copy link
Collaborator Author

Merging this w/o full approval because AFAICT, main is currently broken for local development.

@solebared solebared merged commit 523a388 into main Mar 17, 2021
@solebared solebared deleted the switch-to-dart-sass branch March 17, 2021 22:03
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants