react-static: Using yarn workspaces the build does not contain expected `Head` usage

Are you reporting a bug?

Yes

When using yarn workspaces the build does not contain expected <Head/> usage. I.e. expected <title/> is not in the build output.

It seems that this package or an upstream package requires physical presence of dependencies within the cwd. The build works, but the <Head /> is not applied.

See synopsis at https://github.com/AubreyHewes/react-static-yarn-workspaces-build-error

Environment

  1. react-static -v:
$ react-static -V # you need to update the issue template as it is a capital V ;-)
5.9.7
  1. node -v:
$ node -v
v8.12.0
  1. yarn --version or npm -v:
$ yarn --version
1.9.4
  1. Operating system:
$ lsb_release --description  && uname -a
Description:	Ubuntu 17.10
Linux alita 4.13.0-46-generic #51-Ubuntu SMP Tue Jun 12 12:36:29 UTC 2018 x86_64 x86_64 x86_64 GNU/Linux

Steps to Reproduce the problem

See https://github.com/AubreyHewes/react-static-yarn-workspaces-build-error

Base your steps off of any freshly installed react-static template!

See above repo (react-static basic template)

Expected Behavior

Build output contains <Head/> i.e. custom <title/>

Reproducible Demo

https://github.com/AubreyHewes/react-static-yarn-workspaces-build-error

git checkout tags/step2 as master is the workaround (nohoist)

About this issue

  • Original URL
  • State: closed
  • Created 6 years ago
  • Reactions: 1
  • Comments: 15 (4 by maintainers)

Most upvoted comments

Wow, this rabbit hole is deep! Keep digging!

On Oct 3 2018, at 2:01 pm, Aubrey Hewes notifications@github.com wrote:

So I seem to have found where it breaks… still no idea why. When rendering in yarn workspaces react-helmet Component.rewind() does not contain a mappedState https://github.com/nfl/react-helmet/blob/b22e2f4075971f8b80568cd9911a2143f602add1/src/Helmet.js#L68 (https://link.getmailspring.com/link/1538596912.local-e7150b7b-597b-v1.4.2-f587b7b7@getmailspring.com/0?redirect=https%3A%2F%2Fgithub.com%2Fnfl%2Freact-helmet%2Fblob%2Fb22e2f4075971f8b80568cd9911a2143f602add1%2Fsrc%2FHelmet.js%23L68&recipient=cmVwbHkrMDA1NTI2MDkxOWYzYmYzYmZlNTA2YTg2ZDAwMDFkOTdlMDk0ODkxMTAzZjA3NzcwOTJjZjAwMDAwMDAxMTdjY2UyMWE5MmExNjljZTE1OThkZDVjQHJlcGx5LmdpdGh1Yi5jb20%3D) and so fallbacks to a default state. [react-static] renderToStringAndExtract appHtml <div data-reactroot=""><nav>Home</nav><div class="content"><div>

Welcome to

</div></div></div> Error: [object Object] at renderToStringAndExtract (/app/node_modules/react-static/lib/static/index.js:521:35) at Object.renderToHtml (/app/node_modules/react-static/lib/static/getConfig.js:280:14) at _callee8$ (/app/node_modules/react-static/lib/static/index.js:559:39) at tryCatch (/app/node_modules/regenerator-runtime/runtime.js:62:40) at Generator.invoke [as _invoke] (/app/node_modules/regenerator-runtime/runtime.js:296:22) at Generator.prototype.(anonymous function) [as next] (/app/node_modules/regenerator-runtime /runtime.js:114:21) at step (/app/node_modules/react-static/lib/static/index.js:92:191) at /app/node_modules/react-static/lib/static/index.js:92:437 at new Promise (<anonymous>) at /app/node_modules/react-static/lib/static/index.js:92:99

[react-helmet] renderStatic/rewind mappedState undefined Error: [object Object] at Function.Helmet._class.rewind (/app/node_modules/react-helmet/lib/Helmet.js:262:17) at renderToStringAndExtract (/app/node_modules/react-static/lib/static/index.js:539:62) at Object.renderToHtml (/app/node_modules/react-static/lib/static/getConfig.js:280:14) at _callee8$ (/app/node_modules/react-static/lib/static/index.js:559:39) at tryCatch (/app/node_modules/regenerator-runtime/runtime.js:62:40) at Generator.invoke [as _invoke] (/app/node_modules/regenerator-runtime/runtime.js:296:22) at Generator.prototype.(anonymous function) [as next] (/app/node_modules/regenerator-runtime /runtime.js:114:21) at step (/app/node_modules/react-static/lib/static/index.js:92:191) at /app/node_modules/react-static/lib/static/index.js:92:437 at new Promise (<anonymous>)

[react-helmet] renderStatic/rewind NO MAPPED STATE; FALLBACK

[react-static] renderToStringAndExtract helmet.title <title data-react-helmet="true"></title> Possibly an upstream issue with react-dom/server ? Still digging; -) — You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub (https://link.getmailspring.com/link/1538596912.local-e7150b7b-597b-v1.4.2-f587b7b7@getmailspring.com/1?redirect=https%3A%2F%2Fgithub.com%2Fnozzle%2Freact-static%2Fissues%2F762%23issuecomment-426780089&recipient=cmVwbHkrMDA1NTI2MDkxOWYzYmYzYmZlNTA2YTg2ZDAwMDFkOTdlMDk0ODkxMTAzZjA3NzcwOTJjZjAwMDAwMDAxMTdjY2UyMWE5MmExNjljZTE1OThkZDVjQHJlcGx5LmdpdGh1Yi5jb20%3D), or mute the thread (https://link.getmailspring.com/link/1538596912.local-e7150b7b-597b-v1.4.2-f587b7b7@getmailspring.com/2?redirect=https%3A%2F%2Fgithub.com%2Fnotifications%2Funsubscribe-auth%2FAFUmCQww1wNfJCb9z3f2Trn6cazQTYpLks5uhReagaJpZM4Wy0hB&recipient=cmVwbHkrMDA1NTI2MDkxOWYzYmYzYmZlNTA2YTg2ZDAwMDFkOTdlMDk0ODkxMTAzZjA3NzcwOTJjZjAwMDAwMDAxMTdjY2UyMWE5MmExNjljZTE1OThkZDVjQHJlcGx5LmdpdGh1Yi5jb20%3D).