fluentui icon indicating copy to clipboard operation
fluentui copied to clipboard

Build Fails when I execute yarn build --to @fluentui/react-examples

Open hetanthakkar opened this issue 5 years ago • 29 comments

image

hetanthakkar avatar Jul 01 '21 19:07 hetanthakkar

I got a report of this internally as well. @Hotell, @layershifter, or @ling1726 can you help investigate?

@hetanthakkar1 Just to confirm, did you run yarn after updating from master and before running yarn build? Also, what happens if you run yarn scrub (be sure to commit or stash any changes first) followed by yarn and building?

ecraig12345 avatar Jul 02 '21 01:07 ecraig12345

Can't repro this error after I:

  • Cloned fresh repo
  • yarn
  • yarn build --to @fluentui/react-examples

ling1726 avatar Jul 02 '21 07:07 ling1726

@ling1726 I get an error running yarn scub image

hetanthakkar avatar Jul 02 '21 07:07 hetanthakkar

@hetanthakkar1 git clean -fdx is probably a better option. that scrub command is a bit of legacy and I think @Hotell and I even considered removing it at some point

ling1726 avatar Jul 02 '21 08:07 ling1726

I am trying that

hetanthakkar avatar Jul 02 '21 08:07 hetanthakkar

Build passes on fresh clone (on WSL) ✅

$ yarn buildto @fluentui/react-button
verb @fluentui/react-tabster build completed, took 7.22s
verb @fluentui/react-button build completed, took 9.72s
info [Tasks Count] success: 14, skipped: 0, incomplete: 0

Build fails on existing repo (on Windows) ❌

$ yarn buildto @fluentui/react-button
[11:33:48 AM] ■ finished 'ts:compile' in 3.5s
[11:33:48 AM] ■ started 'ts:postprocess'
[11:33:48 AM] ■ finished 'ts:postprocess' in 0s
[11:33:48 AM] ■ started 'babel:postprocess'
[11:33:50 AM] x Error detected while running 'babel:postprocess'
[11:33:50 AM] x ------------------------------------
[11:33:50 AM] x office-ui-fabric-react\packages\react-button\lib-commonjs\components\CompoundButton\useCompoundButtonStyles.js:35
    padding: useButtonStyles_1.buttonSpacing.medium
                                             ^

TypeError: Cannot read property 'medium' of undefined

layershifter avatar Jul 02 '21 09:07 layershifter

I am getting this error when i execute yarn build --to @fluentui/react-examples image

nancy2681 avatar Jul 02 '21 09:07 nancy2681

I am getting this error when i execute yarn build --to @fluentui/react-examples

Please ensure that your branch is up to date, this file is not present in master anymore: https://github.com/microsoft/fluentui/tree/master/packages/make-styles/src/runtime/utils

layershifter avatar Jul 02 '21 10:07 layershifter

Build passes on fresh clone (on WSL) ✅

$ yarn buildto @fluentui/react-button
verb @fluentui/react-tabster build completed, took 7.22s
verb @fluentui/react-button build completed, took 9.72s
info [Tasks Count] success: 14, skipped: 0, incomplete: 0

Build fails on existing repo (on Windows) ❌

$ yarn buildto @fluentui/react-button
[11:33:48 AM] ■ finished 'ts:compile' in 3.5s
[11:33:48 AM] ■ started 'ts:postprocess'
[11:33:48 AM] ■ finished 'ts:postprocess' in 0s
[11:33:48 AM] ■ started 'babel:postprocess'
[11:33:50 AM] x Error detected while running 'babel:postprocess'
[11:33:50 AM] x ------------------------------------
[11:33:50 AM] x office-ui-fabric-react\packages\react-button\lib-commonjs\components\CompoundButton\useCompoundButtonStyles.js:35
    padding: useButtonStyles_1.buttonSpacing.medium
                                             ^

TypeError: Cannot read property 'medium' of undefined

@layershifter Is there a way to make it work on windows?

hetanthakkar avatar Jul 02 '21 10:07 hetanthakkar

Actually I have solved an issue and I cant submit that issue before ensuring that this command runs perfectly on my changes so I cant file a PR that's why I am troubling you guys

hetanthakkar avatar Jul 02 '21 10:07 hetanthakkar

Build passes on fresh clone (on WSL) ✅

$ yarn buildto @fluentui/react-button
verb @fluentui/react-tabster build completed, took 7.22s
verb @fluentui/react-button build completed, took 9.72s
info [Tasks Count] success: 14, skipped: 0, incomplete: 0

Build fails on existing repo (on Windows) ❌

$ yarn buildto @fluentui/react-button
[11:33:48 AM] ■ finished 'ts:compile' in 3.5s
[11:33:48 AM] ■ started 'ts:postprocess'
[11:33:48 AM] ■ finished 'ts:postprocess' in 0s
[11:33:48 AM] ■ started 'babel:postprocess'
[11:33:50 AM] x Error detected while running 'babel:postprocess'
[11:33:50 AM] x ------------------------------------
[11:33:50 AM] x office-ui-fabric-react\packages\react-button\lib-commonjs\components\CompoundButton\useCompoundButtonStyles.js:35
    padding: useButtonStyles_1.buttonSpacing.medium
                                             ^

TypeError: Cannot read property 'medium' of undefined

Build fails on fresh clone (on Windows) ❌

ERR! [12:21:51 PM] x Error detected while running 'babel:postprocess'
ERR! [12:21:51 PM] x ------------------------------------
ERR! [12:21:51 PM] x fluentui\packages\react-button\lib-commonjs\components\CompoundButton\useCompoundButtonStyles.js:35
ERR!     padding: useButtonStyles_1.buttonSpacing.medium
ERR!                                              ^
ERR!
ERR! TypeError: Cannot read property 'medium' of undefined
ERR!     at fluentui\packages\react-button\src\components\CompoundButton\useCompoundButtonStyles.ts:35:11
ERR!     at fluentui\packages\react-button\lib-commonjs\components\CompoundButton\useCompoundButtonStyles.js:214:3
ERR!     at Script.runInContext (vm.js:127:20)

I will create a PR to disable @linaria/shaker and will create a bug report.

layershifter avatar Jul 02 '21 10:07 layershifter

Yep The build fails on the fresh clone. Thanks for acknowledgement

hetanthakkar avatar Jul 02 '21 10:07 hetanthakkar

PR that disables @linaria/shaker #18809. @hetanthakkar1 once it will be merged to master, you will need to pull latest changes and build will pass:

verb @fluentui/jest-serializer-make-styles build completed, took 8.31s
verb @fluentui/react-tabster build completed, took 12.02s
verb @fluentui/react-button build completed, took 15.67s
info [Tasks Count] success: 14, skipped: 0, incomplete: 0

layershifter avatar Jul 02 '21 10:07 layershifter

@layershifter Thank you so much! Waiting for merge

hetanthakkar avatar Jul 02 '21 10:07 hetanthakkar

I found out the reason, #18816 contains a proper fix 🚀

verb @fluentui/react-make-styles build completed, took 13.33s
verb @fluentui/babel-make-styles build completed, took 13.47s
verb @fluentui/jest-serializer-make-styles build completed, took 8.73s
verb @fluentui/react-tabster build completed, took 12.87s
verb @fluentui/react-button build completed, took 16.18s
info [Tasks Count] success: 14, skipped: 0, incomplete: 0
info ----------------------------------------------
info Took a total of 1m 21.00s to complete

layershifter avatar Jul 02 '21 13:07 layershifter

I am getting a similar issue when I try yarn build to build everything,

0 info it worked if it ends with ok
1 verbose cli [
1 verbose cli   'C:\\Program Files\\nodejs\\node.exe',
1 verbose cli   'C:\\Program Files\\nodejs\\node_modules\\npm\\bin\\npm-cli.js',
1 verbose cli   'run',
1 verbose cli   'build'
1 verbose cli ]
2 info using [email protected]
3 info using [email protected]
4 verbose run-script [ 'prebuild', 'build', 'postbuild' ]
5 info lifecycle @fluentui/[email protected]~prebuild: @fluentui/[email protected]
6 info lifecycle @fluentui/[email protected]~build: @fluentui/[email protected]
7 verbose lifecycle @fluentui/[email protected]~build: unsafe-perm in lifecycle true
8 verbose lifecycle @fluentui/[email protected]~build: PATH: D:\Softwares\nvm\v14.0.0\node_modules\npm\node_modules\npm-lifecycle\node-gyp-bin;D:\Projects\Work\Open Source\fluentui\packages\web-components\node_modules\.bin;C:\Users\Shuja\AppData\Local\Temp\yarn--1625233631201-0.18491805862854482;D:\Projects\Work\Open Source\fluentui\node_modules\.bin;C:\Users\Shuja\AppData\Local\Yarn\Data\link\node_modules\.bin;D:\Projects\Work\Open Source\fluentui\node_modules\.bin;C:\Users\Shuja\AppData\Local\Yarn\bin;C:\Program Files\libexec\lib\node_modules\npm\bin\node-gyp-bin;C:\Program Files\lib\node_modules\npm\bin\node-gyp-bin;C:\Program Files\nodejs\node_modules\npm\bin\node-gyp-bin;C:\Python39\Scripts\;C:\Python39\;D:\Softwares\AdoptOpenJDK\jdk-11.0.10.9-hotspot\bin;C:\Python38\Scripts\;C:\Python38\;C:\Windows\system32;C:\Windows;C:\Windows\System32\Wbem;C:\Windows\System32\WindowsPowerShell\v1.0\;C:\Windows\System32\OpenSSH\;C:\Program Files (x86)\NVIDIA Corporation\PhysX\Common;C:\Program Files\NVIDIA Corporation\NVIDIA NvDLISR;C:\ProgramData\chocolatey\bin;C:\WINDOWS\system32;C:\WINDOWS;C:\WINDOWS\System32\Wbem;C:\WINDOWS\System32\WindowsPowerShell\v1.0\;C:\WINDOWS\System32\OpenSSH\;C:\Program Files\dotnet\;C:\WINDOWS\system32;C:\WINDOWS;C:\WINDOWS\System32\Wbem;C:\WINDOWS\System32\WindowsPowerShell\v1.0\;C:\WINDOWS\System32\OpenSSH\;C:\Program Files\Microsoft SQL Server\130\Tools\Binn\;C:\Program Files\Microsoft SQL Server\Client SDK\ODBC\170\Tools\Binn\;C:\Program Files\PowerShell\7\;C:\Program Files\Git\cmd;C:\Program Files\OpenJDK\openjdk-8u292-b10\bin;%NVM_HOME%;%NVM_SYMLINK%;D:\Softwares\Anaconda;D:\Softwares\Anaconda\Library\mingw-w64\bin;D:\Softwares\Anaconda\Library\usr\bin;D:\Softwares\Anaconda\Library\bin;D:\Softwares\Anaconda\Scripts;C:\Users\Shuja\AppData\Local\Microsoft\WindowsApps;D:\Softwares\Microsoft VS Code\bin;C:\Users\Shuja\.gradle\wrapper\dists\gradle-6.1.1-all\cfmwm155h49vnt3hynmlrsdst\gradle-6.1.1\bin;C:\Users\Shuja\.dotnet\tools;C:\Users\Shuja\AppData\Roaming\Python\Python38\Scripts;C:\Users\Shuja\AppData\Roaming\npm;C:\Users\Shuja\AppData\Local\Android\Sdk\platform-tools;D:\Softwares\nvm;C:\Program Files\nodejs
9 verbose lifecycle @fluentui/[email protected]~build: CWD: D:\Projects\Work\Open Source\fluentui\packages\web-components
10 silly lifecycle @fluentui/[email protected]~build: Args: [
10 silly lifecycle   '/d /s /c',
10 silly lifecycle   'yarn generate-default-palettes && tsc -p ./tsconfig.json && rollup -c && npm run doc'
10 silly lifecycle ]
11 silly lifecycle @fluentui/[email protected]~build: Returned: code: 1  signal: null
12 info lifecycle @fluentui/[email protected]~build: Failed to exec build script
13 verbose stack Error: @fluentui/[email protected] build: `yarn generate-default-palettes && tsc -p ./tsconfig.json && rollup -c && npm run doc`
13 verbose stack Exit status 1
13 verbose stack     at EventEmitter.<anonymous> (D:\Softwares\nvm\v14.0.0\node_modules\npm\node_modules\npm-lifecycle\index.js:332:16)
13 verbose stack     at EventEmitter.emit (events.js:315:20)
13 verbose stack     at ChildProcess.<anonymous> (D:\Softwares\nvm\v14.0.0\node_modules\npm\node_modules\npm-lifecycle\lib\spawn.js:55:14)
13 verbose stack     at ChildProcess.emit (events.js:315:20)
13 verbose stack     at maybeClose (internal/child_process.js:1051:16)
13 verbose stack     at Process.ChildProcess._handle.onexit (internal/child_process.js:287:5)
14 verbose pkgid @fluentui/[email protected]
15 verbose cwd D:\Projects\Work\Open Source\fluentui\packages\web-components
16 verbose Windows_NT 10.0.19043
17 verbose argv "C:\\Program Files\\nodejs\\node.exe" "C:\\Program Files\\nodejs\\node_modules\\npm\\bin\\npm-cli.js" "run" "build"
18 verbose node v14.0.0
19 verbose npm  v6.14.4
20 error code ELIFECYCLE
21 error errno 1
22 error @fluentui/[email protected] build: `yarn generate-default-palettes && tsc -p ./tsconfig.json && rollup -c && npm run doc`
22 error Exit status 1
23 error Failed at the @fluentui/[email protected] build script.
23 error This is probably not a problem with npm. There is likely additional logging output above.
24 verbose exit [ 1, true ]

shujathkhan avatar Jul 02 '21 13:07 shujathkhan

@shujathkhan That's a different issue. Be sure you've run yarn before running yarn build, and if you still have this problem, please file a new issue.

ecraig12345 avatar Jul 02 '21 17:07 ecraig12345

:tada:This issue was addressed in #18816, which has now been successfully released as @fluentui/[email protected].:tada:

Handy links:

msft-fluent-ui-bot avatar Jul 02 '21 23:07 msft-fluent-ui-bot

:tada:This issue was addressed in #18816, which has now been successfully released as @fluentui/[email protected].:tada:

Handy links:

msft-fluent-ui-bot avatar Jul 02 '21 23:07 msft-fluent-ui-bot

:tada:This issue was addressed in #18816, which has now been successfully released as @fluentui/[email protected].:tada:

Handy links:

msft-fluent-ui-bot avatar Jul 02 '21 23:07 msft-fluent-ui-bot