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

Can't install on node 16 #262

Closed
kabouzeid opened this issue Apr 30, 2021 · 10 comments
Closed

Can't install on node 16 #262

kabouzeid opened this issue Apr 30, 2021 · 10 comments
Assignees

Comments

@kabouzeid
Copy link

kabouzeid commented Apr 30, 2021

https://stackoverflow.com/questions/67241196/error-no-template-named-remove-cv-t-in-namespace-std-did-you-mean-remove

@shufo shufo self-assigned this May 6, 2021
@shufo
Copy link
Owner

shufo commented May 7, 2021

Thanks for reporting issue!
I also tried install on node v16.1.0 and it seems ok.

❯ node -v
v16.1.0
~/develop/blade-formatter-node16
❯ yarn remove blade-formatter
yarn remove v1.22.10
warning package.json: No license field
[1/2] Removing module blade-formatter...
[2/2] Regenerating lockfile and installing missing dependencies...
warning No license field
success Uninstalled packages.
Done in 0.45s.
~/develop/blade-formatter-node16
❯ yarn add blade-formatter
yarn add v1.22.10
warning package.json: No license field
warning No license field
[1/4] Resolving packages...
[2/4] Fetching packages...
[3/4] Linking dependencies...
[4/4] Building fresh packages...
success Saved lockfile.
warning No license field
success Saved 69 new dependencies.
info Direct dependencies
└─ blade-formatter@1.11.5
info All dependencies
├─ @babel/runtime-corejs3@7.14.0
├─ @prettier/plugin-php@0.16.1
├─ abbrev@1.1.1
├─ aigle-core@1.0.0
├─ aigle@1.14.1
├─ ansi-regex@5.0.0
├─ ansi-styles@4.3.0
├─ balanced-match@1.0.2
├─ blade-formatter@1.11.5
├─ brace-expansion@1.1.11
├─ buffer-from@1.1.1
├─ chalk@4.1.1
├─ cliui@7.0.4
├─ color-convert@2.0.1
├─ color-name@1.1.4
├─ commander@2.20.3
├─ concat-map@0.0.1
├─ concat-stream@2.0.0
├─ config-chain@1.1.12
├─ core-js-pure@3.12.0
├─ detect-indent@6.0.0
├─ editorconfig@0.15.3
├─ emoji-regex@8.0.0
├─ escalade@3.1.1
├─ esm@3.2.25
├─ fs.realpath@1.0.0
├─ get-caller-file@2.0.5
├─ glob@7.1.7
├─ has-flag@4.0.0
├─ ignore@5.1.8
├─ inflight@1.0.6
├─ ini@1.3.8
├─ is-fullwidth-code-point@3.0.0
├─ js-beautify@1.13.13
├─ linguist-languages@7.14.0
├─ lodash@4.17.21
├─ lru-cache@4.1.5
├─ map-age-cleaner@0.1.3
├─ mem@8.1.1
├─ mimic-fn@3.1.0
├─ minimatch@3.0.4
├─ mkdirp@1.0.4
├─ nan@2.14.2
├─ nopt@5.0.0
├─ oniguruma@7.2.1
├─ p-defer@1.0.0
├─ path-is-absolute@1.0.1
├─ prettier@2.2.1
├─ proto-list@1.2.4
├─ pseudomap@1.0.2
├─ readable-stream@3.6.0
├─ regenerator-runtime@0.13.7
├─ require-directory@2.1.1
├─ safe-buffer@5.2.1
├─ semver@5.7.1
├─ sigmund@1.0.1
├─ string_decoder@1.3.0
├─ string-width@4.2.2
├─ supports-color@7.2.0
├─ typedarray@0.0.6
├─ util-deprecate@1.0.2
├─ vscode-oniguruma@1.3.1
├─ vscode-textmate@4.4.0
├─ wrap-ansi@7.0.0
├─ xregexp@5.0.2
├─ y18n@5.0.8
├─ yallist@2.1.2
├─ yargs-parser@20.2.7
└─ yargs@16.2.0
Done in 12.49s.

That sof link seems describing node-sass issue but blade-formatter is not depend on node-sass so I guess your environment has node-sass dependency or something.
@kabouzeid Could you try install on empty package.json?

e.g.

$ mkdir example
$ cd example
$ echo {} > pacakge.json
$ npm install blade-formatter

@kabouzeid
Copy link
Author

In the case of blade-formatter it was oniguruma. Will try again today, maybe they fixed it.

@kabouzeid
Copy link
Author

Same with node 16.1.0, macOS 11.2.3. Seems like oniguruma is not yet compatible with node 16, no idea why it works for you though.

~ $ yarn global add blade-formatter           
yarn global v1.22.10
[1/4] 🔍  Resolving packages...
[2/4] 🚚  Fetching packages...
[3/4] 🔗  Linking dependencies...
[4/4] 🔨  Building fresh packages...
[1/2] ⠂ oniguruma
error /Users/karim/.config/yarn/global/node_modules/oniguruma: Command failed.
Exit code: 1
Command: node-gyp rebuild
Arguments: 
Directory: /Users/karim/.config/yarn/global/node_modules/oniguruma
Output:
gyp info it worked if it ends with ok
gyp info using node-gyp@7.1.2
gyp info using node@16.1.0 | darwin | x64
gyp info find Python using Python version 3.9.4 found at "/usr/local/opt/python@3.9/bin/python3.9"
(node:11102) [DEP0150] DeprecationWarning: Setting process.config is deprecated. In the future the property will be read-only.
(Use `node --trace-deprecation ...` to show where the warning was created)
gyp info spawn /usr/local/opt/python@3.9/bin/python3.9
gyp info spawn args [
gyp info spawn args   '/usr/local/Cellar/node/16.1.0/libexec/lib/node_modules/npm/node_modules/node-gyp/gyp/gyp_main.py',
gyp info spawn args   'binding.gyp',
gyp info spawn args   '-f',
gyp info spawn args   'make',
gyp info spawn args   '-I',
gyp info spawn args   '/Users/karim/.config/yarn/global/node_modules/oniguruma/build/config.gypi',
gyp info spawn args   '-I',
gyp info spawn args   '/usr/local/Cellar/node/16.1.0/libexec/lib/node_modules/npm/node_modules/node-gyp/addon.gypi',
gyp info spawn args   '-I',
gyp info spawn args   '/Users/karim/Library/Caches/node-gyp/16.1.0/include/node/common.gypi',
gyp info spawn args   '-Dlibrary=shared_library',
gyp info spawn args   '-Dvisibility=default',
gyp info spawn args   '-Dnode_root_dir=/Users/karim/Library/Caches/node-gyp/16.1.0',
gyp info spawn args   '-Dnode_gyp_dir=/usr/local/Cellar/node/16.1.0/libexec/lib/node_modules/npm/node_modules/node-gyp',
gyp info spawn args   '-Dnode_lib_file=/Users/karim/Library/Caches/node-gyp/16.1.0/<(target_arch)/node.lib',
gyp info spawn args   '-Dmodule_root_dir=/Users/karim/.config/yarn/global/node_modules/oniguruma',
gyp info spawn args   '-Dnode_engine=v8',
gyp info spawn args   '--depth=.',
gyp info spawn args   '--no-parallel',
gyp info spawn args   '--generator-output',
gyp info spawn args   'build',
gyp info spawn args   '-Goutput_dir=.'
gyp info spawn args ]
gyp info spawn make
gyp info spawn args [ 'BUILDTYPE=Release', '-C', 'build' ]
  CC(target) Release/obj.target/oniguruma/deps/onig/regcomp.o
  CC(target) Release/obj.target/oniguruma/deps/onig/regenc.o
  CC(target) Release/obj.target/oniguruma/deps/onig/regerror.o
  CC(target) Release/obj.target/oniguruma/deps/onig/regexec.o
  CC(target) Release/obj.target/oniguruma/deps/onig/regext.o
  CC(target) Release/obj.target/oniguruma/deps/onig/reggnu.o
  CC(target) Release/obj.target/oniguruma/deps/onig/regparse.o
  CC(target) Release/obj.target/oniguruma/deps/onig/regposerr.o
  CC(target) Release/obj.target/oniguruma/deps/onig/regposix.o
  CC(target) Release/obj.target/oniguruma/deps/onig/regsyntax.o
  CC(target) Release/obj.target/oniguruma/deps/onig/regtrav.o
  CC(target) Release/obj.target/oniguruma/deps/onig/regversion.o
  CC(target) Release/obj.target/oniguruma/deps/onig/st.o
  CC(target) Release/obj.target/oniguruma/deps/onig/enc/ascii.o
  CC(target) Release/obj.target/oniguruma/deps/onig/enc/big5.o
  CC(target) Release/obj.target/oniguruma/deps/onig/enc/cp1251.o
  CC(target) Release/obj.target/oniguruma/deps/onig/enc/euc_jp.o
  CC(target) Release/obj.target/oniguruma/deps/onig/enc/euc_kr.o
  CC(target) Release/obj.target/oniguruma/deps/onig/enc/euc_tw.o
  CC(target) Release/obj.target/oniguruma/deps/onig/enc/gb18030.o
  CC(target) Release/obj.target/oniguruma/deps/onig/enc/iso8859_1.o
  CC(target) Release/obj.target/oniguruma/deps/onig/enc/iso8859_2.o
  CC(target) Release/obj.target/oniguruma/deps/onig/enc/iso8859_3.o
  CC(target) Release/obj.target/oniguruma/deps/onig/enc/iso8859_4.o
  CC(target) Release/obj.target/oniguruma/deps/onig/enc/iso8859_5.o
  CC(target) Release/obj.target/oniguruma/deps/onig/enc/iso8859_6.o
  CC(target) Release/obj.target/oniguruma/deps/onig/enc/iso8859_7.o
  CC(target) Release/obj.target/oniguruma/deps/onig/enc/iso8859_8.o
  CC(target) Release/obj.target/oniguruma/deps/onig/enc/iso8859_9.o
  CC(target) Release/obj.target/oniguruma/deps/onig/enc/iso8859_10.o
  CC(target) Release/obj.target/oniguruma/deps/onig/enc/iso8859_11.o
  CC(target) Release/obj.target/oniguruma/deps/onig/enc/iso8859_13.o
  CC(target) Release/obj.target/oniguruma/deps/onig/enc/iso8859_14.o
  CC(target) Release/obj.target/oniguruma/deps/onig/enc/iso8859_15.o
  CC(target) Release/obj.target/oniguruma/deps/onig/enc/iso8859_16.o
  CC(target) Release/obj.target/oniguruma/deps/onig/enc/koi8.o
  CC(target) Release/obj.target/oniguruma/deps/onig/enc/koi8_r.o
  CC(target) Release/obj.target/oniguruma/deps/onig/enc/mktable.o
  CC(target) Release/obj.target/oniguruma/deps/onig/enc/sjis.o
  CC(target) Release/obj.target/oniguruma/deps/onig/enc/unicode.o
  CC(target) Release/obj.target/oniguruma/deps/onig/enc/utf16_be.o
  CC(target) Release/obj.target/oniguruma/deps/onig/enc/utf16_le.o
  CC(target) Release/obj.target/oniguruma/deps/onig/enc/utf32_be.o
  CC(target) Release/obj.target/oniguruma/deps/onig/enc/utf32_le.o
  CC(target) Release/obj.target/oniguruma/deps/onig/enc/utf8.o
  LIBTOOL-STATIC Release/oniguruma.a
  CXX(target) Release/obj.target/onig_scanner/src/onig-result.o
In file included from ../src/onig-result.cc:1:
In file included from ../src/onig-result.h:4:
In file included from ../../nan/nan.h:56:
In file included from /Users/karim/Library/Caches/node-gyp/16.1.0/include/node/node.h:63:
In file included from /Users/karim/Library/Caches/node-gyp/16.1.0/include/node/v8.h:30:
/Users/karim/Library/Caches/node-gyp/16.1.0/include/node/v8-internal.h:452:38: error: no template named 'remove_cv_t' in namespace 'std'; did you mean 'remove_cv'?
            !std::is_same<Data, std::remove_cv_t<T>>::value>::Perform(data);
                                ~~~~~^~~~~~~~~~~
                                     remove_cv
/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/c++/v1/type_traits:776:50: note: 'remove_cv' declared here
template <class _Tp> struct _LIBCPP_TEMPLATE_VIS remove_cv
                                                 ^
1 error generated.
make: *** [Release/obj.target/onig_scanner/src/onig-result.o] Error 1
gyp ERR! build error 
gyp ERR! stack Error: `make` failed with exit code: 2
gyp ERR! stack     at ChildProcess.onExit (/usr/local/Cellar/node/16.1.0/libexec/lib/node_modules/npm/node_modules/node-gyp/lib/build.js:194:23)
gyp ERR! stack     at ChildProcess.emit (node:events:365:28)
gyp ERR! stack     at Process.ChildProcess._handle.onexit (node:internal/child_process:290:12)
gyp ERR! System Darwin 20.3.0
gyp ERR! command "/usr/local/Cellar/node/16.1.0/bin/node" "/usr/local/Cellar/node/16.1.0/libexec/lib/node_modules/npm/node_modules/node-gyp/bin/node-gyp.js" "rebuild"
gyp ERR! cwd /Users/karim/.config/yarn/global/node_modules/oniguruma
gyp ERR! node -v v16.1.0
gyp ERR! node-gyp -v v7.1.2
gyp ERR! not ok

@shufo
Copy link
Owner

shufo commented May 7, 2021

This is my environment.

❯ neofetch
         eeeeeeeeeeeeeeeee            shuhei@shuhei-Inspiron-5675
      eeeeeeeeeeeeeeeeeeeeeee         ---------------------------
    eeeee  eeeeeeeeeeee   eeeee       OS: elementary OS 5.1.7 Hera x86_64
  eeee   eeeee       eee     eeee     Host: Inspiron 5675 1.3.6
 eeee   eeee          eee     eeee    Kernel: 5.4.0-59-generic
eee    eee            eee       eee   Uptime: 3 days, 2 hours, 14 mins
eee   eee            eee        eee   Packages: 3124
ee    eee           eeee       eeee   Shell: zsh 5.4.2
ee    eee         eeeee      eeeeee   Resolution: 3840x2160
ee    eee       eeeee      eeeee ee   DE: Pantheon
eee   eeee   eeeeee      eeeee  eee   WM: Mutter(Gala)
eee    eeeeeeeeee     eeeeee    eee   Terminal: tmux
 eeeeeeeeeeeeeeeeeeeeeeee    eeeee    CPU: AMD Ryzen 7 1700X (16) @ 3.400GHz
  eeeeeeee eeeeeeeeeeee      eeee     GPU: NVIDIA GeForce GTX 1060 6GB
    eeeee                 eeeee       Memory: 29550MiB / 64280MiB
      eeeeeee         eeeeeee
         eeeeeeeeeeeeeeeee

Probably linux environment causes different result.

And it seems similar issue also occured on native module compile on macOS with node 16
sass/node-sass#3077 (comment)
microsoft/node-pty#441 (comment)

From above comments, add -std=c++17 might workarounds this issue.

yarn install -std=c++17

@yaegassy
Copy link
Contributor

yaegassy commented May 18, 2021

@shufo Upgrade vscode-textmate to v5.4.0 may work around this problem.

An same issue was also reported in coc-blade-formatter.

@shurizzle taught me how to do this, (Thanks)

[NG] Error

Error
blade-formatter$ yarn install
yarn install v1.22.10
[1/5] 🔍  Validating package.json...
[2/5] 🔍  Resolving packages...
[3/5] 🚚  Fetching packages...
[4/5] 🔗  Linking dependencies...
[5/5] 🔨  Building fresh packages...
[1/2] ⡀ oniguruma
error /private/tmp/blade-formatter/node_modules/oniguruma: Command failed.
Exit code: 1
Command: node-gyp rebuild
Arguments:
Directory: /private/tmp/blade-formatter/node_modules/oniguruma
Output:
gyp info it worked if it ends with ok
gyp info using node-gyp@7.1.2
gyp info using node@16.1.0 | darwin | x64
gyp info find Python using Python version 3.9.5 found at "/Library/Frameworks/Python.framework/Versions/3.9/bin/python3"
(node:68705) [DEP0150] DeprecationWarning: Setting process.config is deprecated. In the future the property will be read-only.
(Use `node --trace-deprecation ...` to show where the warning was created)
gyp info spawn /Library/Frameworks/Python.framework/Versions/3.9/bin/python3
gyp info spawn args [
gyp info spawn args   '/Users/yaegassy/.nodebrew/node/v16.1.0/lib/node_modules/npm/node_modules/node-gyp/gyp/gyp_main.py',
gyp info spawn args   'binding.gyp',
gyp info spawn args   '-f',
gyp info spawn args   'make',
gyp info spawn args   '-I',
gyp info spawn args   '/private/tmp/blade-formatter/node_modules/oniguruma/build/config.gypi',
gyp info spawn args   '-I',
gyp info spawn args   '/Users/yaegassy/.nodebrew/node/v16.1.0/lib/node_modules/npm/node_modules/node-gyp/addon.gypi',
gyp info spawn args   '-I',
gyp info spawn args   '/Users/yaegassy/Library/Caches/node-gyp/16.1.0/include/node/common.gypi',
gyp info spawn args   '-Dlibrary=shared_library',
gyp info spawn args   '-Dvisibility=default',
gyp info spawn args   '-Dnode_root_dir=/Users/yaegassy/Library/Caches/node-gyp/16.1.0',
gyp info spawn args   '-Dnode_gyp_dir=/Users/yaegassy/.nodebrew/node/v16.1.0/lib/node_modules/npm/node_modules/node-gyp',
gyp info spawn args   '-Dnode_lib_file=/Users/yaegassy/Library/Caches/node-gyp/16.1.0/<(target_arch)/node.lib',
gyp info spawn args   '-Dmodule_root_dir=/private/tmp/blade-formatter/node_modules/oniguruma',
gyp info spawn args   '-Dnode_engine=v8',
gyp info spawn args   '--depth=.',
gyp info spawn args   '--no-parallel',
gyp info spawn args   '--generator-output',
gyp info spawn args   'build',
gyp info spawn args   '-Goutput_dir=.'
gyp info spawn args ]
gyp info spawn make
gyp info spawn args [ 'BUILDTYPE=Release', '-C', 'build' ]
  CC(target) Release/obj.target/oniguruma/deps/onig/regcomp.o
  CC(target) Release/obj.target/oniguruma/deps/onig/regenc.o
  CC(target) Release/obj.target/oniguruma/deps/onig/regerror.o
  CC(target) Release/obj.target/oniguruma/deps/onig/regexec.o
  CC(target) Release/obj.target/oniguruma/deps/onig/regext.o
  CC(target) Release/obj.target/oniguruma/deps/onig/reggnu.o
  CC(target) Release/obj.target/oniguruma/deps/onig/regparse.o
  CC(target) Release/obj.target/oniguruma/deps/onig/regposerr.o
  CC(target) Release/obj.target/oniguruma/deps/onig/regposix.o
  CC(target) Release/obj.target/oniguruma/deps/onig/regsyntax.o
  CC(target) Release/obj.target/oniguruma/deps/onig/regtrav.o
  CC(target) Release/obj.target/oniguruma/deps/onig/regversion.o
  CC(target) Release/obj.target/oniguruma/deps/onig/st.o
  CC(target) Release/obj.target/oniguruma/deps/onig/enc/ascii.o
  CC(target) Release/obj.target/oniguruma/deps/onig/enc/big5.o
  CC(target) Release/obj.target/oniguruma/deps/onig/enc/cp1251.o
  CC(target) Release/obj.target/oniguruma/deps/onig/enc/euc_jp.o
  CC(target) Release/obj.target/oniguruma/deps/onig/enc/euc_kr.o
  CC(target) Release/obj.target/oniguruma/deps/onig/enc/euc_tw.o
  CC(target) Release/obj.target/oniguruma/deps/onig/enc/gb18030.o
  CC(target) Release/obj.target/oniguruma/deps/onig/enc/iso8859_1.o
  CC(target) Release/obj.target/oniguruma/deps/onig/enc/iso8859_2.o
  CC(target) Release/obj.target/oniguruma/deps/onig/enc/iso8859_3.o
  CC(target) Release/obj.target/oniguruma/deps/onig/enc/iso8859_4.o
  CC(target) Release/obj.target/oniguruma/deps/onig/enc/iso8859_5.o
  CC(target) Release/obj.target/oniguruma/deps/onig/enc/iso8859_6.o
  CC(target) Release/obj.target/oniguruma/deps/onig/enc/iso8859_7.o
  CC(target) Release/obj.target/oniguruma/deps/onig/enc/iso8859_8.o
  CC(target) Release/obj.target/oniguruma/deps/onig/enc/iso8859_9.o
  CC(target) Release/obj.target/oniguruma/deps/onig/enc/iso8859_10.o
  CC(target) Release/obj.target/oniguruma/deps/onig/enc/iso8859_11.o
  CC(target) Release/obj.target/oniguruma/deps/onig/enc/iso8859_13.o
  CC(target) Release/obj.target/oniguruma/deps/onig/enc/iso8859_14.o
  CC(target) Release/obj.target/oniguruma/deps/onig/enc/iso8859_15.o
  CC(target) Release/obj.target/oniguruma/deps/onig/enc/iso8859_16.o
  CC(target) Release/obj.target/oniguruma/deps/onig/enc/koi8.o
  CC(target) Release/obj.target/oniguruma/deps/onig/enc/koi8_r.o
  CC(target) Release/obj.target/oniguruma/deps/onig/enc/mktable.o
  CC(target) Release/obj.target/oniguruma/deps/onig/enc/sjis.o
  CC(target) Release/obj.target/oniguruma/deps/onig/enc/unicode.o
  CC(target) Release/obj.target/oniguruma/deps/onig/enc/utf16_be.o
  CC(target) Release/obj.target/oniguruma/deps/onig/enc/utf16_le.o
  CC(target) Release/obj.target/oniguruma/deps/onig/enc/utf32_be.o
  CC(target) Release/obj.target/oniguruma/deps/onig/enc/utf32_le.o
  CC(target) Release/obj.target/oniguruma/deps/onig/enc/utf8.o
  LIBTOOL-STATIC Release/oniguruma.a
  CXX(target) Release/obj.target/onig_scanner/src/onig-result.o
In file included from ../src/onig-result.cc:1:
In file included from ../src/onig-result.h:4:
In file included from ../../nan/nan.h:56:
In file included from /Users/yaegassy/Library/Caches/node-gyp/16.1.0/include/node/node.h:63:
In file included from /Users/yaegassy/Library/Caches/node-gyp/16.1.0/include/node/v8.h:30:
/Users/yaegassy/Library/Caches/node-gyp/16.1.0/include/node/v8-internal.h:452:38: error: no template named 'remove_cv_t' in namespace 'std'; did you mean 'remove_cv'?
            !std::is_same<Data, std::remove_cv_t<T>>::value>::Perform(data);
                                ~~~~~^~~~~~~~~~~
                                     remove_cv
/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/../include/c++/v1/type_traits:676:50: note: 'remove_cv' declared here
template <class _Tp> struct _LIBCPP_TEMPLATE_VIS remove_cv
                                                 ^
1 error generated.
make: *** [Release/obj.target/onig_scanner/src/onig-result.o] Error 1
gyp ERR! build error
gyp ERR! stack Error: `make` failed with exit code: 2
gyp ERR! stack     at ChildProcess.onExit (/Users/yaegassy/.nodebrew/node/v16.1.0/lib/node_modules/npm/node_modules/node-gyp/lib/build.js:194:23)
gyp ERR! stack     at ChildProcess.emit (node:events:365:28)
gyp ERR! stack     at Process.ChildProcess._handle.onexit (node:internal/child_process:290:12)
gyp ERR! System Darwin 19.5.0
gyp ERR! command "/Users/yaegassy/.nodebrew/node/v16.1.0/bin/node" "/Users/yaegassy/.nodebrew/node/v16.1.0/lib/node_modules/npm/node_modules/node-gyp/bin/node-gyp.js" "rebuild"
gyp ERR! cwd /private/tmp/blade-formatter/node_modules/oniguruma
gyp ERR! node -v v16.1.0
gyp ERR! node-gyp -v v7.1.2
gyp ERR! not ok

[OK] Upgrade vscode-textmate v5.4.0

cd /tmp
git clone git@github.com:shufo/blade-formatter.git
cd blade-formatter

rm yarn.lock
yarn add vscode-textmate@^5.4.0

# ...snip
✨  Done in 37.52s.

Misc

This will avoid the installation error, but I haven't checked the operation of blade-fomatter yet.

@yaegassy
Copy link
Contributor

I was able to install it by following the steps in this comment, but unfortunately, node v16 gives me an error when formatting. :(

$ node --version
v16.1.0
$ ./bin/blade-formatter --write __tests__/fixtures/blade_brace_without_space.blade.php
E

Fixed: F
Errors: E
Not Changed: .

Errors:

{
  path: '__tests__/fixtures/blade_brace_without_space.blade.php',
  message: 'Must invoke loadWASM first.',
  error: Error: Must invoke loadWASM first.
      at new u (/private/tmp/blade-formatter/node_modules/vscode-oniguruma/release/main.js:1:2639)
      at Object.createOnigString (/private/tmp/blade-formatter/src/vsctm.js:51:36)
      at e.createOnigString (/private/tmp/blade-formatter/node_modules/vscode-textmate/release/main.js:1:5786)
      at e._tokenize (/private/tmp/blade-formatter/node_modules/vscode-textmate/release/main.js:1:7837)
      at e.tokenizeLine (/private/tmp/blade-formatter/node_modules/vscode-textmate/release/main.js:1:6980)
      at /private/tmp/blade-formatter/src/vsctm.js:60:22
      at arrayMap (/private/tmp/blade-formatter/node_modules/lodash/lodash.js:653:23)
      at Function.map (/private/tmp/blade-formatter/node_modules/lodash/lodash.js:9622:14)
      at VscodeTextmate.tokenizeLines (/private/tmp/blade-formatter/src/vsctm.js:59:14)
      at /private/tmp/blade-formatter/src/formatter.js:479:38
}

@yaegassy
Copy link
Contributor

I tried it again in my environment, but I guess the only way to do it for now is to use the -std=c++17 workaround... :(

env CXXFLAGS=-std=c++17 yarn install

@shurizzle
Copy link

shurizzle commented May 24, 2021

I was able to install it by following the steps in this comment, but unfortunately, node v16 gives me an error when formatting. :(

$ node --version
v16.1.0
$ ./bin/blade-formatter --write __tests__/fixtures/blade_brace_without_space.blade.php
E

Fixed: F
Errors: E
Not Changed: .

Errors:

{
  path: '__tests__/fixtures/blade_brace_without_space.blade.php',
  message: 'Must invoke loadWASM first.',
  error: Error: Must invoke loadWASM first.
      at new u (/private/tmp/blade-formatter/node_modules/vscode-oniguruma/release/main.js:1:2639)
      at Object.createOnigString (/private/tmp/blade-formatter/src/vsctm.js:51:36)
      at e.createOnigString (/private/tmp/blade-formatter/node_modules/vscode-textmate/release/main.js:1:5786)
      at e._tokenize (/private/tmp/blade-formatter/node_modules/vscode-textmate/release/main.js:1:7837)
      at e.tokenizeLine (/private/tmp/blade-formatter/node_modules/vscode-textmate/release/main.js:1:6980)
      at /private/tmp/blade-formatter/src/vsctm.js:60:22
      at arrayMap (/private/tmp/blade-formatter/node_modules/lodash/lodash.js:653:23)
      at Function.map (/private/tmp/blade-formatter/node_modules/lodash/lodash.js:9622:14)
      at VscodeTextmate.tokenizeLines (/private/tmp/blade-formatter/src/vsctm.js:59:14)
      at /private/tmp/blade-formatter/src/formatter.js:479:38
}

Solved with
https://github.com/shurizzle/blade-formatter/commit/81c82c8fbec7659876bd4b28c1c91c1c226868b0

Obviously this is not a viable fix for the library, it's just a fix for my vim configuration.
By the way the new vscode-oniguruma doesn't use compiled module anymore, in place it uses a wasm-compiled library that you need to load manually before using it. They used this approach to support web browsers.

@yaegassy
Copy link
Contributor

I have confirmed that this issue was resolved in v1.11.7 in my environment.

@shufo
Copy link
Owner

shufo commented Jun 16, 2021

Sorry for late reply. I'm bit busy for work on this month...
Now https://github.com/shufo/blade-formatter/releases/tag/v1.11.7 supported Node.js v16.x!

@kabouzeid
Thanks for reporting the issue!
@shurizzle
Thanks for try fixing the issue! This commit https://github.com/shurizzle/blade-formatter/commit/81c82c8fbec7659876bd4b28c1c91c1c226868b0 perfectly solved the issue. You saved my weekend.
@yaegassy
Thanks for try reproducing the issue!

@shufo shufo closed this as completed Jun 16, 2021
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

No branches or pull requests

4 participants