firebase / firebaseui-web

FirebaseUI is an open-source JavaScript library for Web that provides simple, customizable UI bindings on top of Firebase SDKs to eliminate boilerplate code and promote best practices.
https://firebase.google.com/
Apache License 2.0
4.58k stars 1.06k forks source link

Localized Build doesn't work #679

Open pfiadDi opened 4 years ago

pfiadDi commented 4 years ago

[REQUIRED] Describe your environment

[REQUIRED] Describe the problem

I try to build a localized version as described on your pages. But after npm install I get this error

make: *** [Release/obj.target/binding/src/create_string.o] Error 1
gyp ERR! build error 
gyp ERR! stack Error: `make` failed with exit code: 2
gyp ERR! stack     at ChildProcess.onExit (/Users/**/firebaseui-web/node_modules/node-gyp/lib/build.js:262:23)
gyp ERR! stack     at ChildProcess.emit (events.js:210:5)
gyp ERR! stack     at Process.ChildProcess._handle.onexit (internal/child_process.js:272:12)
gyp ERR! System Darwin 16.7.0
gyp ERR! command "/usr/local/Cellar/node/12.12.0/bin/node" "/Users/**/firebaseui-web/node_modules/node-gyp/bin/node-gyp.js" "rebuild" "--verbose" "--libsass_ext=" "--libsass_cflags=" "--libsass_ldflags=" "--libsass_library="
gyp ERR! cwd /Users/**/firebaseui-web/node_modules/node-sass
gyp ERR! node -v v12.12.0
gyp ERR! node-gyp -v v3.8.0
gyp ERR! not ok 
Build failed with error code: 1
npm WARN optional SKIPPING OPTIONAL DEPENDENCY: google-closure-compiler-linux@20190415.0.0 (node_modules/google-closure-compiler-linux):
npm WARN notsup SKIPPING OPTIONAL DEPENDENCY: Unsupported platform for google-closure-compiler-linux@20190415.0.0: wanted {"os":"linux","arch":"x64,x86"} (current: {"os":"darwin","arch":"x64"})

npm ERR! code ELIFECYCLE
npm ERR! errno 1
npm ERR! node-sass@3.13.1 postinstall: `node scripts/build.js`
npm ERR! Exit status 1
npm ERR! 
npm ERR! Failed at the node-sass@3.13.1 postinstall script.
npm ERR! This is probably not a problem with npm. There is likely additional logging output above.

npm ERR! A complete log of this run can be found in:
npm ERR!     /Users/**/.npm/_logs/2020-03-06T20_20_25_233Z-debug.log

If I try to go on and run npm run build build-npm-de I get this error:

    throw err;
    ^

Error: Cannot find module 'gulp-sass'
Require stack:
- /Users/**/firebaseui-web/gulpfile.js
- /Users/**/firebaseui-web/node_modules/gulp/node_modules/gulp-cli/lib/versioned/^4.0.0/index.js
- /Users/**/firebaseui-web/node_modules/gulp/node_modules/gulp-cli/index.js
- /Users/**/firebaseui-web/node_modules/gulp/bin/gulp.js
    at Function.Module._resolveFilename (internal/modules/cjs/loader.js:794:15)
    at Function.Module._load (internal/modules/cjs/loader.js:687:27)
    at Module.require (internal/modules/cjs/loader.js:849:19)
    at require (internal/modules/cjs/helpers.js:74:18)
    at Object.<anonymous> (/Users/**/firebaseui-web/gulpfile.js:25:14)
    at Module._compile (internal/modules/cjs/loader.js:956:30)
    at Object.Module._extensions..js (internal/modules/cjs/loader.js:973:10)
    at Module.load (internal/modules/cjs/loader.js:812:32)
    at Function.Module._load (internal/modules/cjs/loader.js:724:14)
    at Module.require (internal/modules/cjs/loader.js:849:19) {
  code: 'MODULE_NOT_FOUND',
  requireStack: [
    '/Users/**/firebaseui-web/gulpfile.js',
    '/Users/**/firebaseui-web/node_modules/gulp/node_modules/gulp-cli/lib/versioned/^4.0.0/index.js',
    '/Users/**/firebaseui-web/node_modules/gulp/node_modules/gulp-cli/index.js',
    '/Users/**/firebaseui-web/node_modules/gulp/bin/gulp.js'
  ]
}
npm ERR! code ELIFECYCLE
npm ERR! errno 1
npm ERR! firebaseui@4.4.0 build: `gulp "build-npm-de"`
npm ERR! Exit status 1
npm ERR! 
npm ERR! Failed at the firebaseui@4.4.0 build script.
npm ERR! This is probably not a problem with npm. There is likely additional logging output above.

npm ERR! A complete log of this run can be found in:
npm ERR!     /Users/**/.npm/_logs/2020-03-06T20_26_49_848Z-debug.log 

Steps to reproduce:

run the instructions on your page:

Help would be very much appreciated - and I need the German version so if anyone has a built one, that would be also very helpful. BR

pfiadDi commented 4 years ago

I also had it run on a Linux version and it didn't work, with this error output:

rm -rf "Release/sass.a" && cp -af "Release/obj.target/src/sass.a" "Release/sass.a"
  g++ '-DNODE_GYP_MODULE_NAME=binding' '-DUSING_UV_SHARED=1' '-DUSING_V8_SHARED=1' '-DV8_DEPRECATION_WARNINGS=1' '-DV8_DEPRECATION_WARNINGS' '-DV8_IMMINENT_DEPRECATION_WARNINGS' '-D_LARGEFILE_SOURCE' '-D_FILE_OFFSET_BITS=64' '-D__STDC_FORMAT_MACROS' '-DOPENSSL_NO_PINSHARED' '-DOPENSSL_THREADS' '-DBUILDING_NODE_EXTENSION' -I/root/.node-gyp/13.10.1/include/node -I/root/.node-gyp/13.10.1/src -I/root/.node-gyp/13.10.1/deps/openssl/config -I/root/.node-gyp/13.10.1/deps/openssl/openssl/include -I/root/.node-gyp/13.10.1/deps/uv/include -I/root/.node-gyp/13.10.1/deps/zlib -I/root/.node-gyp/13.10.1/deps/v8/include -I../../nan -I../src/libsass/include  -fPIC -pthread -Wall -Wextra -Wno-unused-parameter -m64 -O3 -fno-omit-frame-pointer -fno-rtti -fno-exceptions -std=gnu++1y -std=c++0x -MMD -MF ./Release/.deps/Release/obj.target/binding/src/binding.o.d.raw   -c -o Release/obj.target/binding/src/binding.o ../src/binding.cpp
../src/binding.cpp: In function 'void MakeCallback(uv_work_t*)':
../src/binding.cpp:246:39: warning: 'v8::Local<v8::Value> Nan::Callback::Call(int, v8::Local<v8::Value>*) const' is deprecated [-Wdeprecated-declarations]
     ctx_w->success_callback->Call(0, 0);
                                       ^
In file included from ../src/binding.cpp:1:0:
../../nan/nan.h:1740:3: note: declared here
   Call(int argc, v8::Local<v8::Value> argv[]) const {
   ^~~~
../src/binding.cpp:254:40: warning: 'v8::Local<v8::Value> Nan::Callback::Call(int, v8::Local<v8::Value>*) const' is deprecated [-Wdeprecated-declarations]
     ctx_w->error_callback->Call(1, argv);
                                        ^
In file included from ../src/binding.cpp:1:0:
../../nan/nan.h:1740:3: note: declared here
   Call(int argc, v8::Local<v8::Value> argv[]) const {
   ^~~~
In file included from ../src/custom_function_bridge.h:7:0,
                 from ../src/sass_context_wrapper.h:9,
                 from ../src/binding.cpp:3:
../src/callback_bridge.h: In instantiation of 'T CallbackBridge<T, L>::operator()(std::vector<void*>) [with T = Sass_Import**; L = void*]':
../src/binding.cpp:19:21:   required from here
../src/callback_bridge.h:111:5: warning: 'v8::Local<v8::Value> Nan::Callback::Call(int, v8::Local<v8::Value>*) const' is deprecated [-Wdeprecated-declarations]
     );
     ^
In file included from ../src/binding.cpp:1:0:
../../nan/nan.h:1740:3: note: declared here
   Call(int argc, v8::Local<v8::Value> argv[]) const {
   ^~~~
In file included from ../src/custom_function_bridge.h:7:0,
                 from ../src/sass_context_wrapper.h:9,
                 from ../src/binding.cpp:3:
../src/callback_bridge.h: In instantiation of 'T CallbackBridge<T, L>::operator()(std::vector<void*>) [with T = Sass_Value*; L = void*]':
../src/binding.cpp:32:21:   required from here
../src/callback_bridge.h:111:5: warning: 'v8::Local<v8::Value> Nan::Callback::Call(int, v8::Local<v8::Value>*) const' is deprecated [-Wdeprecated-declarations]
     );
     ^
In file included from ../src/binding.cpp:1:0:
../../nan/nan.h:1740:3: note: declared here
   Call(int argc, v8::Local<v8::Value> argv[]) const {
   ^~~~
In file included from ../src/custom_function_bridge.h:7:0,
                 from ../src/sass_context_wrapper.h:9,
                 from ../src/binding.cpp:3:
../src/callback_bridge.h: In instantiation of 'static void CallbackBridge<T, L>::dispatched_async_uv_callback(uv_async_t*) [with T = Sass_Value*; L = void*; uv_async_t = uv_async_s]':
../src/callback_bridge.h:68:51:   required from 'CallbackBridge<T, L>::CallbackBridge(v8::Local<v8::Function>, bool) [with T = Sass_Value*; L = void*]'
../src/custom_function_bridge.h:11:109:   required from here
../src/callback_bridge.h:162:3: warning: 'v8::Local<v8::Value> Nan::Callback::Call(int, v8::Local<v8::Value>*) const' is deprecated [-Wdeprecated-declarations]
   bridge->callback->Call(argv_v8.size(), &argv_v8[0]);
   ^~~~~~
In file included from ../src/binding.cpp:1:0:
../../nan/nan.h:1740:3: note: declared here
   Call(int argc, v8::Local<v8::Value> argv[]) const {
   ^~~~
In file included from ../src/custom_function_bridge.h:7:0,
                 from ../src/sass_context_wrapper.h:9,
                 from ../src/binding.cpp:3:
../src/callback_bridge.h: In instantiation of 'static void CallbackBridge<T, L>::dispatched_async_uv_callback(uv_async_t*) [with T = Sass_Import**; L = void*; uv_async_t = uv_async_s]':
../src/callback_bridge.h:68:51:   required from 'CallbackBridge<T, L>::CallbackBridge(v8::Local<v8::Function>, bool) [with T = Sass_Import**; L = void*]'
../src/custom_importer_bridge.h:13:112:   required from here
../src/callback_bridge.h:162:3: warning: 'v8::Local<v8::Value> Nan::Callback::Call(int, v8::Local<v8::Value>*) const' is deprecated [-Wdeprecated-declarations]
   bridge->callback->Call(argv_v8.size(), &argv_v8[0]);
   ^~~~~~
In file included from ../src/binding.cpp:1:0:
../../nan/nan.h:1740:3: note: declared here
   Call(int argc, v8::Local<v8::Value> argv[]) const {
   ^~~~
  g++ '-DNODE_GYP_MODULE_NAME=binding' '-DUSING_UV_SHARED=1' '-DUSING_V8_SHARED=1' '-DV8_DEPRECATION_WARNINGS=1' '-DV8_DEPRECATION_WARNINGS' '-DV8_IMMINENT_DEPRECATION_WARNINGS' '-D_LARGEFILE_SOURCE' '-D_FILE_OFFSET_BITS=64' '-D__STDC_FORMAT_MACROS' '-DOPENSSL_NO_PINSHARED' '-DOPENSSL_THREADS' '-DBUILDING_NODE_EXTENSION' -I/root/.node-gyp/13.10.1/include/node -I/root/.node-gyp/13.10.1/src -I/root/.node-gyp/13.10.1/deps/openssl/config -I/root/.node-gyp/13.10.1/deps/openssl/openssl/include -I/root/.node-gyp/13.10.1/deps/uv/include -I/root/.node-gyp/13.10.1/deps/zlib -I/root/.node-gyp/13.10.1/deps/v8/include -I../../nan -I../src/libsass/include  -fPIC -pthread -Wall -Wextra -Wno-unused-parameter -m64 -O3 -fno-omit-frame-pointer -fno-rtti -fno-exceptions -std=gnu++1y -std=c++0x -MMD -MF ./Release/.deps/Release/obj.target/binding/src/create_string.o.d.raw   -c -o Release/obj.target/binding/src/create_string.o ../src/create_string.cpp
../src/create_string.cpp: In function 'char* create_string(Nan::MaybeLocal<v8::Value>)':
../src/create_string.cpp:17:37: error: no matching function for call to 'v8::String::Utf8Value::Utf8Value(v8::Local<v8::Value>&)'
   v8::String::Utf8Value string(value);
                                     ^
In file included from /root/.node-gyp/13.10.1/include/node/node.h:67:0,
                 from ../../nan/nan.h:54,
                 from ../src/create_string.cpp:1:
/root/.node-gyp/13.10.1/include/node/v8.h:3180:5: note: candidate: v8::String::Utf8Value::Utf8Value(v8::Isolate*, v8::Local<v8::Value>)
     Utf8Value(Isolate* isolate, Local<v8::Value> obj);
     ^~~~~~~~~
/root/.node-gyp/13.10.1/include/node/v8.h:3180:5: note:   candidate expects 2 arguments, 1 provided
binding.target.mk:131: recipe for target 'Release/obj.target/binding/src/create_string.o' failed
make: *** [Release/obj.target/binding/src/create_string.o] Error 1
make: Leaving directory '/firebaseui-web/node_modules/node-sass/build'
gyp ERR! build error 
gyp ERR! stack Error: `make` failed with exit code: 2
gyp ERR! stack     at ChildProcess.onExit (/firebaseui-web/node_modules/node-gyp/lib/build.js:262:23)
gyp ERR! stack     at ChildProcess.emit (events.js:316:20)
gyp ERR! stack     at Process.ChildProcess._handle.onexit (internal/child_process.js:275:12)
gyp ERR! System Linux 4.19.0-8-amd64
gyp ERR! command "/usr/local/bin/node" "/firebaseui-web/node_modules/node-gyp/bin/node-gyp.js" "rebuild" "--verbose" "--libsass_ext=" "--libsass_cflags=" "--libsass_ldflags=" "--libsass_library="
gyp ERR! cwd /firebaseui-web/node_modules/node-sass
gyp ERR! node -v v13.10.1
gyp ERR! node-gyp -v v3.8.0
gyp ERR! not ok 
Build failed with error code: 1
npm WARN optional SKIPPING OPTIONAL DEPENDENCY: fsevents@1.2.9 (node_modules/fsevents):
npm WARN notsup SKIPPING OPTIONAL DEPENDENCY: Unsupported platform for fsevents@1.2.9: wanted {"os":"darwin","arch":"any"} (current: {"os":"linux","arch":"x64"})
npm WARN optional SKIPPING OPTIONAL DEPENDENCY: google-closure-compiler-osx@20190415.0.0 (node_modules/google-closure-compiler-osx):
npm WARN notsup SKIPPING OPTIONAL DEPENDENCY: Unsupported platform for google-closure-compiler-osx@20190415.0.0: wanted {"os":"darwin","arch":"x64,x86"} (current: {"os":"linux","arch":"x64"})

npm ERR! code ELIFECYCLE
npm ERR! errno 1
npm ERR! node-sass@3.13.1 postinstall: `node scripts/build.js`
npm ERR! Exit status 1
npm ERR! 
npm ERR! Failed at the node-sass@3.13.1 postinstall script.
npm ERR! This is probably not a problem with npm. There is likely additional logging output above.

npm ERR! A complete log of this run can be found in:
npm ERR!     /root/.npm/_logs/2020-03-10T10_17_06_562Z-debug.log
cernockyd commented 4 years ago

I have the same problem here. Did you guys figure it out?

pfiadDi commented 4 years ago

It worked on a Windows machine but not on Linux and Mac. But would be great to have a reaction from the maintainers here - it's a pretty big issue in my opinion.

cernockyd commented 4 years ago

Hello, I finally found a way how to build it on my Mac machine. In order to build the package I decided to remove all parts that that were blocking my npm install and npm build attempts. That means that I commented out gulp tasks related to CSS work (which I didn't needed since I wanted only localized js part) and other things that required node-sass installation which my install and build attempts had a problem with :-)

netzwerg commented 4 years ago

For anyone just interested in building artifacts with localized text: I created a minimal fork which skips all CSS, SASS, tests etc. (like described by @dalibor-123 ). Tested on Mac/OSX.

https://github.com/netzwerg/firebaseui-web

Hope it helps!

pfiadDi commented 4 years ago

great thank you @netzwerg ! A little bit disappointing though that we didn't hear anything from Google. They want us to use the UI to push a more secure and their UI concept but no reaction what so ever in such an important issue...

hellocaio commented 4 years ago

Thanks a bunch @netzwerg! It works great!

I can't get the patch-package to manage it tho, I get the error:

patch-package 6.2.2
• Creating temporary folder
• Installing firebaseui@4.5.0 with npm
• Diffing your files with clean files
Error: ENOENT: no such file or directory, stat '/MyProject/node_modules/firebaseui/node_modules/.bin/in-install'
    at Object.statSync (fs.js:926:3)
    at Object.statSync (/MyProject/node_modules/graceful-fs/polyfills.js:308:16)
    at checkStats (/MyProject/node_modules/patch-package/node_modules/fs-extra/lib/copy-sync/copy-sync.js:171:22)
    at checkPaths (/MyProject/node_modules/patch-package/node_modules/fs-extra/lib/copy-sync/copy-sync.js:183:31)
    at copyDirItem (/MyProject/node_modules/patch-package/node_modules/fs-extra/lib/copy-sync/copy-sync.js:117:20)
    at /MyProject/node_modules/patch-package/node_modules/fs-extra/lib/copy-sync/copy-sync.js:111:39
    at Array.forEach (<anonymous>)
    at copyDir (/MyProject/node_modules/patch-package/node_modules/fs-extra/lib/copy-sync/copy-sync.js:111:23)
    at mkDirAndCopy (/MyProject/node_modules/patch-package/node_modules/fs-extra/lib/copy-sync/copy-sync.js:106:3)
    at onDir (/MyProject/node_modules/patch-package/node_modules/fs-extra/lib/copy-sync/copy-sync.js:97:37) {
errno: -2,
syscall: 'stat',
code: 'ENOENT',
path: '/MyProject/node_modules/firebaseui/node_modules/.bin/in-install'
}
ENOENT: no such file or directory, stat '/MyProject/node_modules/firebaseui/node_modules/.bin/in-install'

:/