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

Development on M1 based Macs (Apple Silicon, arm64) #481

Closed
joeyguerra opened this issue Apr 1, 2022 · 9 comments
Closed

Development on M1 based Macs (Apple Silicon, arm64) #481

joeyguerra opened this issue Apr 1, 2022 · 9 comments
Labels
feature New feature or request

Comments

@joeyguerra
Copy link

Problem description (Describe the problem you would like to solve with this feature request or suggested idea).
node-sass does not support the M1 architecture.

How often do you encounter this problem (Describe how frequently this problem occurs).
Every time someone with an M1 based Mac tries to build the app for development.

Alternatives considered (Describe any alternative features or products you've considered).
sass or css variables

Additional information (Add any other context or details here).
End of the console output when running

yarn package
ERROR in ./redisinsight/ui/src/pages/workbench/components/wb-view/WBView/styles.module.scss
[1] Module build failed (from ./node_modules/mini-css-extract-plugin/dist/loader.js):
[1] ModuleError: Module Error (from ./node_modules/sass-loader/dist/cjs.js):
[1] Node Sass does not yet support your current environment: OS X 64-bit with Unsupported runtime (93)
[1] For more information on which environments are supported please see:
[1] https://github.com/sass/node-sass/releases/tag/v5.0.0
[1]     at Object.emitError (/Users/<redacted>/src/<redacted>/RedisInsight/node_modules/webpack/lib/NormalModule.js:447:6)
[1]     at getSassImplementation (/Users/<redacted>/src/<redacted>/RedisInsight/node_modules/sass-loader/dist/utils.js:59:21)
[1]     at Object.loader (/Users/<redacted>/src/<redacted>/RedisInsight/node_modules/sass-loader/dist/index.js:35:59)
[1]  @ ./redisinsight/ui/src/pages/workbench/components/wb-view/WBView/WBView.tsx 27:0-42 75:35-51 90:15-26 98:18-32 98:54-70 118:18-32 118:54-70 145:17-34 170:17-36 184:20-39 184:41-65
[1]  @ ./redisinsight/ui/src/pages/workbench/components/wb-view/WBView/index.ts 10:0-30 11:15-21
[1]  @ ./redisinsight/ui/src/pages/workbench/components/wb-view/WBViewWrapper.tsx 28:0-30 207:42-48
[1]  @ ./redisinsight/ui/src/pages/workbench/components/wb-view/index.ts 10:0-44 11:15-28
[1]  @ ./redisinsight/ui/src/pages/workbench/WorkbenchPage.tsx 25:0-49 67:42-55
[1]  @ ./redisinsight/ui/src/pages/workbench/index.ts 10:0-44 11:15-28
[1]  @ ./redisinsight/ui/src/components/main-router/constants/defaultRoutes.ts 14:0-50 23:13-26
[1]  @ ./redisinsight/ui/src/components/main-router/MainRouter.tsx 26:0-55 57:7-25
[1]  @ ./redisinsight/ui/src/components/main/MainComponent.tsx 14:0-51 20:24-34
[1]  @ ./redisinsight/ui/src/App.tsx 25:0-60 117:38-51
[1]  @ ./redisinsight/ui/src/electron/AppElectron.tsx
[1]  @ ./redisinsight/ui/indexElectron.tsx
[1] 
[1] 222 ERRORS in child compilations
[1] webpack 5.14.0 compiled with 337 errors in 54563 ms
@joeyguerra joeyguerra added the feature New feature or request label Apr 1, 2022
@zalenskiSofteq
Copy link
Collaborator

Hi Joey Guerra
Could you run npm rebuild node-sass? for fix problem and then again run yarn package

@joeyguerra
Copy link
Author

joeyguerra commented Apr 1, 2022

Hey Zalenski. Thanks for the suggestion.

Yes, I've tried npm rebuild node-sass. That particular command appears to succeed. But then when I execute yarn install again, I get more errors.

Ultimately, there's many issues with trying to build from source on an M1.

node-sass is deprecated
sqlite3 from npmjs requires a version of node-gyp that implements a python 2 syntax
@elastic/datemath requires moment, which is not found

Thus far, I've had to:

rm yarn.lock
rm redisinsight/yarn.lock
rm redisinsight/api/yarn.lock
nvm use 14
yarn add mapbox/node-sqlite3
yarn add moment
yarn install -std=c++17
yarn --cwd redisinsight/api/ install
yarn --cwd redisinsight/api/ build 
yarn start

The above set of commands, run separately, worked once. But when I cleaned everything and ran these commands in one go, I got errors again.

I'm trying to solve each roadblock as they come up. But there's lots of non-determinism in the build execution.

@zalenskiSofteq
Copy link
Collaborator

I think you shouldn't have removed yarn.lock files.
After remove yarn.lock files and run yarn install yarn automatically update all dependencies. It may make a new errors for build

@joeyguerra
Copy link
Author

Initially, I didn't. And there were other errors. Essentially, I can't just git clone and yarn install because there's errors.

@zalenskiSofteq
Copy link
Collaborator

We have in the plan a user story about migrate from node-sass to dart-sass and increase node version.
May be it will help

@joeyguerra
Copy link
Author

Yes. I think that's great. Should I close this issue then?

@zalenskiSofteq
Copy link
Collaborator

After implementation I will post a message here. I will ask you try again. If there are no problems we will close this issue.

On our m1 devices this issue isn't reproduce.

@joeyguerra
Copy link
Author

Thank you.

@ViktarStarastsenka
Copy link
Collaborator

Hi @joeyguerra , the node and node-sass versions have been increased, please re-open the ticket if it is still relevant.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
feature New feature or request
Projects
None yet
Development

No branches or pull requests

3 participants