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

bug: yarn link not working for monorepo setup #6801

Open
IlCallo opened this issue Dec 7, 2018 · 3 comments
Open

bug: yarn link not working for monorepo setup #6801

IlCallo opened this issue Dec 7, 2018 · 3 comments
Assignees
Labels

Comments

@IlCallo
Copy link

IlCallo commented Dec 7, 2018

Do you want to request a feature or report a bug?
bug

What is the current behavior?
yarn link doesn't seem to work for monorepo setup, in this case expecially Angular Material monorepo.
See angular/components#14270

What is the expected behavior?
The symlink should work

Please mention your node.js, yarn and operating system version.
Node 10.13.0
yarn 1.12.3
OS: windows 10

@ghost ghost assigned rally25rs Dec 7, 2018
@ghost ghost added the triaged label Dec 7, 2018
@marvinhagemeister
Copy link

marvinhagemeister commented Mar 8, 2019

We're running into a similar issue with preact@next. Our structure is like this:

/subpackage1
  /package.json
  /dist/...
/subpackage2
  /package.json
  /dist/...
/dist
package.json

Only the top-level module can be required when linking via yarn link. Neither of the sub-packages will work. This is the code that triggers the error:

const { Component } = require("preact");
const { useState } = require("preact/hooks"); // imports "preact"
console.log(Component, useState);

And the error itself:

internal/modules/cjs/loader.js:605
    throw err;
    ^

Error: Cannot find module 'preact'
    at Function.Module._resolveFilename (internal/modules/cjs/loader.js:603:15)
    at Function.Module._load (internal/modules/cjs/loader.js:529:25)
    at Module.require (internal/modules/cjs/loader.js:657:17)
    at require (internal/modules/cjs/helpers.js:20:18)
    at Object.<anonymous> (/home/marvinh/dev/github/preact/hooks/dist/hooks.js:1:73)
    at Module._compile (internal/modules/cjs/loader.js:721:30)
    at Object.Module._extensions..js (internal/modules/cjs/loader.js:732:10)
    at Module.load (internal/modules/cjs/loader.js:620:32)
    at tryModuleLoad (internal/modules/cjs/loader.js:560:12)

@oschade
Copy link

oschade commented Mar 16, 2019

Will there be an update for this?

@rsoika
Copy link

rsoika commented Feb 10, 2024

Have the same problem....

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

5 participants