Skip to content
GitLab
Projects Groups Snippets
  • /
  • Help
    • Help
    • Support
    • Community forum
    • Submit feedback
    • Contribute to GitLab
  • Sign in / Register
  • C create-react-app
  • Project information
    • Project information
    • Activity
    • Labels
    • Members
  • Repository
    • Repository
    • Files
    • Commits
    • Branches
    • Tags
    • Contributors
    • Graph
    • Compare
  • Issues 1,547
    • Issues 1,547
    • List
    • Boards
    • Service Desk
    • Milestones
  • Merge requests 417
    • Merge requests 417
  • CI/CD
    • CI/CD
    • Pipelines
    • Jobs
    • Schedules
  • Deployments
    • Deployments
    • Environments
    • Releases
  • Packages and registries
    • Packages and registries
    • Package Registry
    • Infrastructure Registry
  • Monitor
    • Monitor
    • Incidents
  • Analytics
    • Analytics
    • Value stream
    • CI/CD
    • Repository
  • Wiki
    • Wiki
  • Snippets
    • Snippets
  • Activity
  • Graph
  • Create a new issue
  • Jobs
  • Commits
  • Issue Boards
Collapse sidebar
  • Meta
  • create-react-app
  • Issues
  • #8757
Closed
Open
Issue created Apr 01, 2020 by Administrator@rootContributor

Import error with workspaces using yarn 2 (berry) PnP

Created by: oscar-b

Describe the bug

When setting up a CRA project with yarn workspaces, importing a library in the same workspace fails when using yarn 2 berry which has PnP mode by default.

Environment

Environment Info:

current version of create-react-app: 3.4.1 running from /Users/oscar/.config/yarn/global/node_modules/create-react-app

System: OS: macOS 10.15.4 CPU: (8) x64 Intel(R) Core(TM) i5-8259U CPU @ 2.30GHz Binaries: Node: 10.15.3 - /usr/local/bin/node Yarn: 2.0.0-rc.31 - /usr/local/bin/yarn npm: 6.4.1 - /usr/local/bin/npm Browsers: Chrome: 80.0.3987.149 Firefox: 73.0.1 Safari: 13.1 npmPackages: react: Not Found react-dom: Not Found react-scripts: Not Found npmGlobalPackages: create-react-app: Not Found

Steps to reproduce

See steps in repo: https://github.com/oscar-b/styled-pnp/commits/cra-berry-workspaces

Expected behavior

It should compile.

Actual behavior

$ yarn build
Creating an optimized production build...
Failed to compile.

./src/App.js
You attempted to import /Users/oscar/dev/test/styled-pnp/.yarn/$$virtual/lib-virtual-7d458e3583/1/lib which falls outside of the project src/ directory. Relative imports outside of src/ are not supported.
You can either move it inside src/, or add a symlink to it from project's node_modules/.

Reproducible demo

https://github.com/oscar-b/styled-pnp/commits/cra-berry-workspaces

Assignee
Assign to
Time tracking