question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Using yarn workspaces the build does not contain expected `Head` usage

See original GitHub issue

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)

Issue Analytics

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

github_iconTop GitHub Comments

1reaction
tannerlinsleycommented, Oct 3, 2018

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).

0reactions
tannerlinsleycommented, Dec 12, 2018

nohoist is the recommended solution for now. Thanks for your help @AubreyHewes!

Read more comments on GitHub >

github_iconTop Results From Across the Web

No yarn workspaces detected despite using workspaces for ...
my test repository I'm using three branches one for each version of yarn. 3.1.1 seems to be stuck and using up all build...
Read more >
Workspaces - Yarn
Workspaces are a new way to set up your package architecture that's available by default starting from Yarn 1.0. It allows you to...
Read more >
Monorepo Dependency Chain Overreaching - Stack Overflow
FAILED Installed the foreach Workspace package, and ran yarn workspaces ... head-first into the situation that my monorepo no longer builds.
Read more >
Creating a Yarn Monorepo in 2022 - Heygrady
This is similar to the Turborepo starter but it doesn't use turbo to ... This expects you to have a script called release...
Read more >
Monorepo Javascript Projects with Yarn Workspaces and Lerna
You may have noticed that the dependencies were not installed in a node_modules folder in the monorepo-storybook folder. Instead, it was ...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found