Giter Club home page Giter Club logo

Comments (9)

pastor3llo avatar pastor3llo commented on May 14, 2024 1

i just took the repo as is and i did:
$ yarn
$ cd ~/repos/cra-workspaces-poc/apps
create-react-app --scripts-version @f1lt3r/[email protected] app-foo
$ cd ~/repos/cra-workspaces-poc/apps/app-foo
yarn start was ok, but on
$ yarn test

and i got:
` FAIL src/App.test.js
● Test suite failed to run

Cannot find module '@project/comp-one' from 'App.js'

  2 | import logo from './logo.svg';
  3 | import './App.css';
> 4 | import CompOne from '@project/comp-one';
    | ^
  5 | 
  6 | class App extends Component {
  7 |     render() {

  at Resolver.resolveModule (../../node_modules/jest-resolve/build/index.js:221:17)
  at Object.<anonymous> (src/App.js:4:1)

Test Suites: 1 failed, 1 total
Tests: 0 total
Snapshots: 0 total
Time: 1.427s
Ran all test suites.

Watch Usage
› Press f to run only failed tests.
› Press o to only run tests related to changed files.
› Press q to quit watch mode.
› Press t to filter by a test name regex pattern.
› Press p to filter by a filename regex pattern.
› Press Enter to trigger a test run.`

from react-workspaces-playground.

Remimstr avatar Remimstr commented on May 14, 2024 1

That suggestion fixed it for me. Thank you for the help!

from react-workspaces-playground.

F1LT3R avatar F1LT3R commented on May 14, 2024

How are you running the tests?

from react-workspaces-playground.

Remimstr avatar Remimstr commented on May 14, 2024

I have experienced the same behaviour both with my own monorepo and a clone of this one.

from react-workspaces-playground.

Remimstr avatar Remimstr commented on May 14, 2024

@F1LT3R this is a really big hurdle to me using this approach on my codebase. Is there anything I can do to help fix it?

from react-workspaces-playground.

F1LT3R avatar F1LT3R commented on May 14, 2024

Should be working now @Remimstr @pastor3llo you want to checkout and test?

from react-workspaces-playground.

Remimstr avatar Remimstr commented on May 14, 2024

Unfortunately no, it's still not working. I did exactly the steps as you outlined for a new repo:

git clone [email protected]:react-workspaces/cra-workspaces-playground.git
cd cra-workspaces-playground
yarn
cd packages/apps/app-one
yarn test

and it still gives the same "Cannot find module '@project/comp-one' from 'App.js' error.

In case it's relevant, I'm using node v11.5.0 yarn v1.15.2 and npm v6.4.1

from react-workspaces-playground.

alistair-hmh avatar alistair-hmh commented on May 14, 2024

Working here...

Screen Shot 2019-04-27 at 9 09 18 AM

You might need to pull this repo and try that way.

I think following the steps there are parts missing that would make testing work for you.

from react-workspaces-playground.

alistair-hmh avatar alistair-hmh commented on May 14, 2024

@Remimstr try adding "main": "src/index.js" to each package.json.

from react-workspaces-playground.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.