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

Working with linked packages #129

Open
msokk opened this issue Aug 25, 2016 · 4 comments
Open

Working with linked packages #129

msokk opened this issue Aug 25, 2016 · 4 comments

Comments

@msokk
Copy link

msokk commented Aug 25, 2016

Hi,

I hit into one little snag when setting it up. We have split our app into private npm packages and in development we are running everything with symlinks (npm link).

Given that this package uses module scope (https://github.com/Khan/aphrodite/blob/master/src/inject.js#L105), it's not possible to have multiple dependency declarations of this package as the module variables are cached separately.
For example if there is a generic server package and a project package, with both declaring aphrodite in package.json the inject.js modules will differ, running into Cannot automatically buffer without a document flow and causing the server to crash.
In production the dependency tree is deduped and there is one instance of the aphrodite package.

One possible option would be to break variables out of module scope into global/window.
I wonder if fixing this would be in the scope of the project?
We have a workaround of importing aphrodite through common utility package to prevent duplicates.

@kentcdodds
Copy link
Contributor

Hi there. Was this submitted by mistake? What is this issue for?

@msokk
Copy link
Author

msokk commented Aug 25, 2016

Sorry, I posted the issue description now, I managed to somehow ctrl+enter submit it emptily.

@omerzach
Copy link
Contributor

omerzach commented Jun 15, 2017

I think we have this same issue—we're using npm link with private repos (via Lerna) and getting the Cannot automatically buffer without a document despite (I believe) doing server-side rendering like the examples show.

@zaklampert
Copy link

zaklampert commented May 24, 2018

+1, same issue here using npm link and importing a custom component library to a server-rendered app

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